Download Handling, Clean Up Drone Folder Leftovers

This commit is contained in:
Qstick
2017-09-17 23:00:37 -04:00
parent 9f689c0233
commit 405e7f981d
24 changed files with 467 additions and 754 deletions
@@ -1,7 +1,6 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Download;
using NzbDrone.Core.Download.Clients;
@@ -24,7 +23,6 @@ namespace NzbDrone.Core.HealthCheck.Checks
public override HealthCheck Check()
{
var droneFactoryFolder = new OsPath(_configService.DownloadedAlbumsFolder);
List<ImportMechanismCheckStatus> downloadClients;
try
@@ -42,9 +40,6 @@ namespace NzbDrone.Core.HealthCheck.Checks
}
var downloadClientIsLocalHost = downloadClients.All(v => v.Status.IsLocalhost);
var downloadClientOutputInDroneFactory = !droneFactoryFolder.IsEmpty &&
downloadClients.Any(v => v.Status.OutputRootFolders != null &&
v.Status.OutputRootFolders.Any(droneFactoryFolder.Contains));
if (!_configService.IsDefined("EnableCompletedDownloadHandling"))
{
@@ -56,32 +51,20 @@ namespace NzbDrone.Core.HealthCheck.Checks
if (downloadClients.All(v => v.DownloadClient is Sabnzbd))
{
// With Sabnzbd we can check if the category should be changed.
if (downloadClientOutputInDroneFactory)
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling if possible (Sabnzbd - Conflicting Category)", "Migrating-to-Completed-Download-Handling#sabnzbd-conflicting-download-client-category");
}
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling if possible (Sabnzbd)", "Migrating-to-Completed-Download-Handling#sabnzbd-enable-completed-download-handling");
}
if (downloadClients.All(v => v.DownloadClient is Nzbget))
{
// With Nzbget we can check if the category should be changed.
if (downloadClientOutputInDroneFactory)
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling if possible (Nzbget - Conflicting Category)", "Migrating-to-Completed-Download-Handling#nzbget-conflicting-download-client-category");
}
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling if possible (Nzbget)", "Migrating-to-Completed-Download-Handling#nzbget-enable-completed-download-handling");
}
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling if possible", "Migrating-to-Completed-Download-Handling");
}
if (!_configService.EnableCompletedDownloadHandling && droneFactoryFolder.IsEmpty)
if (!_configService.EnableCompletedDownloadHandling)
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling or configure Drone factory");
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling");
}
return new HealthCheck(GetType());