diff --git a/src/NzbDrone.Core/Download/FailedDownloadService.cs b/src/NzbDrone.Core/Download/FailedDownloadService.cs index 2c44b4419..76efd35c2 100644 --- a/src/NzbDrone.Core/Download/FailedDownloadService.cs +++ b/src/NzbDrone.Core/Download/FailedDownloadService.cs @@ -21,8 +21,6 @@ public class FailedDownloadService : IFailedDownloadService, IExecute grabbedHistory, List failedHistory) { - var downloadClientQueue = _downloadClient.GetQueue().ToList(); + var downloadClientQueue = GetDownloadClient().GetQueue().ToList(); var failedItems = downloadClientQueue.Where(q => q.Title.StartsWith("ENCRYPTED / ")).ToList(); if (!failedItems.Any()) @@ -96,14 +92,14 @@ private void CheckQueue(List grabbedHistory, List grabbedHistory, List failedHistory) { - var downloadClientHistory = _downloadClient.GetHistory(0, 20).ToList(); + var downloadClientHistory = GetDownloadClient().GetHistory(0, 20).ToList(); var failedItems = downloadClientHistory.Where(h => h.Status == HistoryStatus.Failed).ToList(); if (!failedItems.Any()) @@ -135,7 +131,7 @@ private void CheckHistory(List grabbedHistory, List historyItems, stri }); } + private IDownloadClient GetDownloadClient() + { + return _downloadClientProvider.GetDownloadClient(); + } + public void Execute(FailedDownloadCommand message) { CheckForFailedDownloads();