Upstream Changes to DownloadClients and Indexers

This commit is contained in:
Qstick
2017-10-26 23:21:06 -04:00
parent f6d1b77b45
commit 13bfb73ee9
80 changed files with 1521 additions and 654 deletions
+10 -6
View File
@@ -1,4 +1,4 @@
using System;
using System;
using NLog;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Extensions;
@@ -20,18 +20,21 @@ namespace NzbDrone.Core.Download
public class DownloadService : IDownloadService
{
private readonly IProvideDownloadClient _downloadClientProvider;
private readonly IDownloadClientStatusService _downloadClientStatusService;
private readonly IIndexerStatusService _indexerStatusService;
private readonly IRateLimitService _rateLimitService;
private readonly IEventAggregator _eventAggregator;
private readonly Logger _logger;
public DownloadService(IProvideDownloadClient downloadClientProvider,
IIndexerStatusService indexerStatusService,
IRateLimitService rateLimitService,
IEventAggregator eventAggregator,
Logger logger)
IDownloadClientStatusService downloadClientStatusService,
IIndexerStatusService indexerStatusService,
IRateLimitService rateLimitService,
IEventAggregator eventAggregator,
Logger logger)
{
_downloadClientProvider = downloadClientProvider;
_downloadClientStatusService = downloadClientStatusService;
_indexerStatusService = indexerStatusService;
_rateLimitService = rateLimitService;
_eventAggregator = eventAggregator;
@@ -63,6 +66,7 @@ namespace NzbDrone.Core.Download
try
{
downloadClientId = downloadClient.Download(remoteAlbum);
_downloadClientStatusService.RecordSuccess(downloadClient.Definition.Id);
_indexerStatusService.RecordSuccess(remoteAlbum.Release.IndexerId);
}
catch (ReleaseDownloadException ex)
@@ -91,4 +95,4 @@ namespace NzbDrone.Core.Download
_eventAggregator.PublishEvent(albumGrabbedEvent);
}
}
}
}