1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-08-18 16:29:41 +02:00

Fix function name and use out var for try get in DownloadClientProvider

This commit is contained in:
Mark McDowall 2023-05-12 16:58:18 -07:00 committed by Bogdan
parent 38d946ed79
commit a953d1a6c5

View File

@ -92,7 +92,7 @@ public IEnumerable<IDownloadClient> GetDownloadClients(bool filterBlockedClients
if (filterBlockedClients)
{
return FilterBlockedIndexers(enabledClients).ToList();
return FilterBlockedDownloadClients(enabledClients).ToList();
}
return enabledClients;
@ -103,15 +103,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;