1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

New: Minimum Age setting to deal with propagation issues (Usenet only)

This commit is contained in:
Mark McDowall
2014-12-15 15:40:53 -08:00
parent eeafa2cb64
commit 580f03a5bc
12 changed files with 150 additions and 5 deletions
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Messaging.Events;
@@ -36,6 +37,7 @@ namespace NzbDrone.Core.Download.Pending
private readonly ISeriesService _seriesService;
private readonly IParsingService _parsingService;
private readonly IDelayProfileService _delayProfileService;
private readonly IConfigService _configService;
private readonly IEventAggregator _eventAggregator;
private readonly Logger _logger;
@@ -43,6 +45,7 @@ namespace NzbDrone.Core.Download.Pending
ISeriesService seriesService,
IParsingService parsingService,
IDelayProfileService delayProfileService,
IConfigService configService,
IEventAggregator eventAggregator,
Logger logger)
{
@@ -50,6 +53,7 @@ namespace NzbDrone.Core.Download.Pending
_seriesService = seriesService;
_parsingService = parsingService;
_delayProfileService = delayProfileService;
_configService = configService;
_eventAggregator = eventAggregator;
_logger = logger;
}
@@ -202,8 +206,10 @@ namespace NzbDrone.Core.Download.Pending
private int GetDelay(RemoteEpisode remoteEpisode)
{
var delayProfile = _delayProfileService.AllForTags(remoteEpisode.Series.Tags).OrderBy(d => d.Order).First();
var delay = delayProfile.GetProtocolDelay(remoteEpisode.Release.DownloadProtocol);
var minimumAge = _configService.MinimumAge;
return delayProfile.GetProtocolDelay(remoteEpisode.Release.DownloadProtocol);
return new [] { delay, minimumAge }.Max();
}
private void RemoveGrabbed(RemoteEpisode remoteEpisode)