Improved logic for root folder downloading health check (#6287)

pull/6276/head
Robin Dadswell 4 years ago committed by GitHub
parent b9abc1be11
commit df3253f55c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,7 @@
using System; using System;
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
using NzbDrone.Core.Download.Clients; using NzbDrone.Core.Download.Clients;
@ -45,17 +46,14 @@ namespace NzbDrone.Core.HealthCheck.Checks
{ {
var status = client.GetStatus(); var status = client.GetStatus();
var folders = status.OutputRootFolders; var folders = status.OutputRootFolders;
if (folders != null)
{
foreach (var folder in folders) foreach (var folder in folders)
{ {
if (rootFolders.Any(r => r.Path == folder.FullPath)) if (rootFolders.Any(r => r.Path.PathEquals(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");
} }
} }
} }
}
catch (DownloadClientException ex) catch (DownloadClientException ex)
{ {
_logger.Debug(ex, "Unable to communicate with {0}", client.Definition.Name); _logger.Debug(ex, "Unable to communicate with {0}", client.Definition.Name);

Loading…
Cancel
Save