mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
New: Drone now uses the Download Client API to determine if a download is ready for import. (User configuration is required to replace the drone factory with this feature)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Download;
|
||||
|
||||
namespace NzbDrone.Core.HealthCheck.Checks
|
||||
@@ -14,16 +15,19 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
||||
|
||||
public override HealthCheck Check()
|
||||
{
|
||||
var downloadClient = _downloadClientProvider.GetDownloadClient();
|
||||
var downloadClients = _downloadClientProvider.GetDownloadClients();
|
||||
|
||||
if (downloadClient == null)
|
||||
if (downloadClients.Count() == 0)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No download client is available");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
downloadClient.GetQueue();
|
||||
foreach (var downloadClient in downloadClients)
|
||||
{
|
||||
downloadClient.GetItems();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user