From f6c05d4456a5667398319e249614e2eed115621e Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 5 Aug 2023 09:55:36 +0300 Subject: [PATCH] Fixed: Ensure failing providers are marked as failed when testing all --- 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 ee155cb90..ba5ea27f2 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; }