From bc0bd647df10c9383249b5d284bdbf03f33f6395 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 19 Nov 2013 22:24:45 -0800 Subject: [PATCH] No longer saving download client for entire the life cycle --- .../Download/FailedDownloadService.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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();