From b8da8ec6da864700f899959087ee2409972c5ded Mon Sep 17 00:00:00 2001 From: "servarr[bot]" <68984020+servarr[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:28:00 +0300 Subject: [PATCH] Fixed: Ensure failing providers are marked as failed when testing all (#3977) (cherry picked from commit f6c05d4456a5667398319e249614e2eed115621e) Co-authored-by: Bogdan --- src/NzbDrone.Core/Download/DownloadClientFactory.cs | 11 ++++++++++- src/NzbDrone.Core/ImportLists/ImportListFactory.cs | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/DownloadClientFactory.cs b/src/NzbDrone.Core/Download/DownloadClientFactory.cs index 3c7d4c3b5..b2235a0c9 100644 --- a/src/NzbDrone.Core/Download/DownloadClientFactory.cs +++ b/src/NzbDrone.Core/Download/DownloadClientFactory.cs @@ -74,10 +74,19 @@ namespace NzbDrone.Core.Download { var result = base.Test(definition); - if ((result == null || result.IsValid) && definition.Id != 0) + if (definition.Id == 0) + { + return result; + } + + if (result == null || result.IsValid) { _downloadClientStatusService.RecordSuccess(definition.Id); } + else + { + _downloadClientStatusService.RecordFailure(definition.Id); + } return result; } diff --git a/src/NzbDrone.Core/ImportLists/ImportListFactory.cs b/src/NzbDrone.Core/ImportLists/ImportListFactory.cs index 5ac6135c1..0e20a82af 100644 --- a/src/NzbDrone.Core/ImportLists/ImportListFactory.cs +++ b/src/NzbDrone.Core/ImportLists/ImportListFactory.cs @@ -75,10 +75,19 @@ namespace NzbDrone.Core.ImportLists { var result = base.Test(definition); - if ((result == null || result.IsValid) && definition.Id != 0) + if (definition.Id == 0) + { + return result; + } + + if (result == null || result.IsValid) { _importListStatusService.RecordSuccess(definition.Id); } + else + { + _importListStatusService.RecordFailure(definition.Id); + } return result; }