|
|
@ -1,9 +1,12 @@
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.CustomFormats;
|
|
|
|
using NzbDrone.Core.CustomFormats;
|
|
|
|
using NzbDrone.Core.Download.TrackedDownloads;
|
|
|
|
using NzbDrone.Core.Download.TrackedDownloads;
|
|
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Qualities;
|
|
|
|
using NzbDrone.Core.Queue;
|
|
|
|
using NzbDrone.Core.Queue;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
|
@ -13,16 +16,19 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
|
|
private readonly IQueueService _queueService;
|
|
|
|
private readonly IQueueService _queueService;
|
|
|
|
private readonly UpgradableSpecification _upgradableSpecification;
|
|
|
|
private readonly UpgradableSpecification _upgradableSpecification;
|
|
|
|
private readonly ICustomFormatCalculationService _formatService;
|
|
|
|
private readonly ICustomFormatCalculationService _formatService;
|
|
|
|
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public QueueSpecification(IQueueService queueService,
|
|
|
|
public QueueSpecification(IQueueService queueService,
|
|
|
|
UpgradableSpecification upgradableSpecification,
|
|
|
|
UpgradableSpecification upgradableSpecification,
|
|
|
|
ICustomFormatCalculationService formatService,
|
|
|
|
ICustomFormatCalculationService formatService,
|
|
|
|
|
|
|
|
IConfigService configService,
|
|
|
|
Logger logger)
|
|
|
|
Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_queueService = queueService;
|
|
|
|
_queueService = queueService;
|
|
|
|
_upgradableSpecification = upgradableSpecification;
|
|
|
|
_upgradableSpecification = upgradableSpecification;
|
|
|
|
_formatService = formatService;
|
|
|
|
_formatService = formatService;
|
|
|
|
|
|
|
|
_configService = configService;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -84,6 +90,15 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Decision.Reject("Another release is queued and the Quality profile does not allow upgrades");
|
|
|
|
return Decision.Reject("Another release is queued and the Quality profile does not allow upgrades");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_upgradableSpecification.IsRevisionUpgrade(remoteEpisode.ParsedEpisodeInfo.Quality, subject.ParsedEpisodeInfo.Quality))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_configService.DownloadPropersAndRepacks == ProperDownloadTypes.DoNotUpgrade)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.Debug("Auto downloading of propers is disabled");
|
|
|
|
|
|
|
|
return Decision.Reject("Proper downloading is disabled");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Decision.Accept();
|
|
|
|
return Decision.Accept();
|
|
|
|