From df3253f55c5ba1513f712f5c517eb8097d357ab0 Mon Sep 17 00:00:00 2001 From: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com> Date: Sun, 9 May 2021 00:43:56 +0100 Subject: [PATCH] Improved logic for root folder downloading health check (#6287) --- .../Checks/DownloadClientRootFolderCheck.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientRootFolderCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientRootFolderCheck.cs index fd1340e0a..3a10dbbce 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientRootFolderCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientRootFolderCheck.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Download; using NzbDrone.Core.Download.Clients; @@ -45,14 +46,11 @@ public override HealthCheck Check() { var status = client.GetStatus(); var folders = status.OutputRootFolders; - if (folders != null) + foreach (var folder in folders) { - foreach (var folder in folders) + if (rootFolders.Any(r => r.Path.PathEquals(folder.FullPath))) { - if (rootFolders.Any(r => r.Path == folder.FullPath)) - { - return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format(_localizationService.GetLocalizedString("DownloadClientCheckDownloadingToRoot"), client.Definition.Name, folder.FullPath), "#downloads_in_root_folder"); - } + return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format(_localizationService.GetLocalizedString("DownloadClientCheckDownloadingToRoot"), client.Definition.Name, folder.FullPath), "#downloads_in_root_folder"); } } }