From 8e69415d64b14b1af2e45f347bfa4db35f8d2ba4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 3 Nov 2024 18:16:39 +0200 Subject: [PATCH] Check for disabled till value in filtering blocked providers --- src/NzbDrone.Core/Applications/ApplicationFactory.cs | 2 +- src/NzbDrone.Core/Download/DownloadClientFactory.cs | 2 +- src/NzbDrone.Core/Indexers/IndexerFactory.cs | 2 +- src/NzbDrone.Core/Notifications/NotificationFactory.cs | 2 +- src/Prowlarr.Api.V1/Indexers/NewznabController.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Applications/ApplicationFactory.cs b/src/NzbDrone.Core/Applications/ApplicationFactory.cs index 492710fee..2ecd2e78b 100644 --- a/src/NzbDrone.Core/Applications/ApplicationFactory.cs +++ b/src/NzbDrone.Core/Applications/ApplicationFactory.cs @@ -53,7 +53,7 @@ private IEnumerable FilterBlockedApplications(IEnumerable FilterBlockedClients(IEnumerable FilterBlockedIndexers(IEnumerable indexe foreach (var indexer in indexers) { - if (blockedIndexers.TryGetValue(indexer.Definition.Id, out var blockedIndexerStatus)) + if (blockedIndexers.TryGetValue(indexer.Definition.Id, out var blockedIndexerStatus) && blockedIndexerStatus.DisabledTill.HasValue) { _logger.Debug("Temporarily ignoring indexer {0} till {1} due to recent failures.", indexer.Definition.Name, blockedIndexerStatus.DisabledTill.Value.ToLocalTime()); continue; diff --git a/src/NzbDrone.Core/Notifications/NotificationFactory.cs b/src/NzbDrone.Core/Notifications/NotificationFactory.cs index f9d79940e..824aae0b5 100644 --- a/src/NzbDrone.Core/Notifications/NotificationFactory.cs +++ b/src/NzbDrone.Core/Notifications/NotificationFactory.cs @@ -79,7 +79,7 @@ private IEnumerable FilterBlockedNotifications(IEnumerable v.ProviderId, v => v); - return blockedIndexers.TryGetValue(indexer.Definition.Id, out var blockedIndexerStatus) ? blockedIndexerStatus : null; + return blockedIndexers.GetValueOrDefault(indexer.Definition.Id); } private void AddRetryAfterHeader(int retryAfterSeconds)