mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fix function name and use out var for try get in DownloadClientProvider
(cherry picked from commit a953d1a6c50bc1ee05a2fc4183d2b4d9aba5b586)
This commit is contained in:
parent
6ae9741266
commit
e35f38fee6
1 changed files with 3 additions and 5 deletions
|
@ -92,7 +92,7 @@ namespace NzbDrone.Core.Download
|
||||||
|
|
||||||
if (filterBlockedClients)
|
if (filterBlockedClients)
|
||||||
{
|
{
|
||||||
return FilterBlockedIndexers(enabledClients).ToList();
|
return FilterBlockedDownloadClients(enabledClients).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return enabledClients;
|
return enabledClients;
|
||||||
|
@ -103,15 +103,13 @@ namespace NzbDrone.Core.Download
|
||||||
return _downloadClientFactory.GetAvailableProviders().Single(d => d.Definition.Id == id);
|
return _downloadClientFactory.GetAvailableProviders().Single(d => d.Definition.Id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<IDownloadClient> FilterBlockedIndexers(IEnumerable<IDownloadClient> clients)
|
private IEnumerable<IDownloadClient> FilterBlockedDownloadClients(IEnumerable<IDownloadClient> clients)
|
||||||
{
|
{
|
||||||
var blockedClients = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
|
var blockedClients = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
|
||||||
|
|
||||||
foreach (var client in clients)
|
foreach (var client in clients)
|
||||||
{
|
{
|
||||||
DownloadClientStatus blockedClientStatus;
|
if (blockedClients.TryGetValue(client.Definition.Id, out var blockedClientStatus))
|
||||||
|
|
||||||
if (blockedClients.TryGetValue(client.Definition.Id, out blockedClientStatus))
|
|
||||||
{
|
{
|
||||||
_logger.Debug("Temporarily ignoring client {0} till {1} due to recent failures.", client.Definition.Name, blockedClientStatus.DisabledTill.Value.ToLocalTime());
|
_logger.Debug("Temporarily ignoring client {0} till {1} due to recent failures.", client.Definition.Name, blockedClientStatus.DisabledTill.Value.ToLocalTime());
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue