mirror of
https://github.com/Readarr/Readarr
synced 2025-12-14 12:24:49 +01:00
Fix function name and use out var for try get in DownloadClientProvider
(cherry picked from commit a953d1a6c50bc1ee05a2fc4183d2b4d9aba5b586)
This commit is contained in:
parent
d7b1a36a50
commit
3f58693780
1 changed files with 3 additions and 5 deletions
|
|
@ -73,7 +73,7 @@ public IEnumerable<IDownloadClient> GetDownloadClients(bool filterBlockedClients
|
|||
|
||||
if (filterBlockedClients)
|
||||
{
|
||||
return FilterBlockedIndexers(enabledClients).ToList();
|
||||
return FilterBlockedDownloadClients(enabledClients).ToList();
|
||||
}
|
||||
|
||||
return enabledClients;
|
||||
|
|
@ -84,15 +84,13 @@ public IDownloadClient Get(int 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);
|
||||
|
||||
foreach (var client in clients)
|
||||
{
|
||||
DownloadClientStatus blockedClientStatus;
|
||||
|
||||
if (blockedClients.TryGetValue(client.Definition.Id, out blockedClientStatus))
|
||||
if (blockedClients.TryGetValue(client.Definition.Id, out var blockedClientStatus))
|
||||
{
|
||||
_logger.Debug("Temporarily ignoring client {0} till {1} due to recent failures.", client.Definition.Name, blockedClientStatus.DisabledTill.Value.ToLocalTime());
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue