|
|
@ -29,21 +29,18 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
private readonly IPendingReleaseRepository _repository;
|
|
|
|
private readonly IPendingReleaseRepository _repository;
|
|
|
|
private readonly ISeriesService _seriesService;
|
|
|
|
private readonly ISeriesService _seriesService;
|
|
|
|
private readonly IParsingService _parsingService;
|
|
|
|
private readonly IParsingService _parsingService;
|
|
|
|
private readonly IDownloadService _downloadService;
|
|
|
|
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public PendingReleaseService(IPendingReleaseRepository repository,
|
|
|
|
public PendingReleaseService(IPendingReleaseRepository repository,
|
|
|
|
ISeriesService seriesService,
|
|
|
|
ISeriesService seriesService,
|
|
|
|
IParsingService parsingService,
|
|
|
|
IParsingService parsingService,
|
|
|
|
IDownloadService downloadService,
|
|
|
|
|
|
|
|
IEventAggregator eventAggregator,
|
|
|
|
IEventAggregator eventAggregator,
|
|
|
|
Logger logger)
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_repository = repository;
|
|
|
|
_repository = repository;
|
|
|
|
_seriesService = seriesService;
|
|
|
|
_seriesService = seriesService;
|
|
|
|
_parsingService = parsingService;
|
|
|
|
_parsingService = parsingService;
|
|
|
|
_downloadService = downloadService;
|
|
|
|
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -141,6 +138,9 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var episode in pendingRelease.RemoteEpisode.Episodes)
|
|
|
|
foreach (var episode in pendingRelease.RemoteEpisode.Episodes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var ect = pendingRelease.Release.PublishDate.AddHours(
|
|
|
|
|
|
|
|
pendingRelease.RemoteEpisode.Series.Profile.Value.GrabDelay);
|
|
|
|
|
|
|
|
|
|
|
|
var queue = new Queue.Queue
|
|
|
|
var queue = new Queue.Queue
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = episode.Id ^ (pendingRelease.Id << 16),
|
|
|
|
Id = episode.Id ^ (pendingRelease.Id << 16),
|
|
|
@ -150,10 +150,8 @@ namespace NzbDrone.Core.Download.Pending
|
|
|
|
Title = pendingRelease.Title,
|
|
|
|
Title = pendingRelease.Title,
|
|
|
|
Size = pendingRelease.RemoteEpisode.Release.Size,
|
|
|
|
Size = pendingRelease.RemoteEpisode.Release.Size,
|
|
|
|
Sizeleft = pendingRelease.RemoteEpisode.Release.Size,
|
|
|
|
Sizeleft = pendingRelease.RemoteEpisode.Release.Size,
|
|
|
|
Timeleft =
|
|
|
|
Timeleft = ect.Subtract(DateTime.UtcNow),
|
|
|
|
pendingRelease.Release.PublishDate.AddHours(
|
|
|
|
EstimatedCompletionTime = ect,
|
|
|
|
pendingRelease.RemoteEpisode.Series.Profile.Value.GrabDelay)
|
|
|
|
|
|
|
|
.Subtract(DateTime.UtcNow),
|
|
|
|
|
|
|
|
Status = "Pending",
|
|
|
|
Status = "Pending",
|
|
|
|
RemoteEpisode = pendingRelease.RemoteEpisode
|
|
|
|
RemoteEpisode = pendingRelease.RemoteEpisode
|
|
|
|
};
|
|
|
|
};
|
|
|
|