|
|
@ -13,18 +13,21 @@ namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
private readonly AcceptableSizeSpecification _acceptableSizeSpecification;
|
|
|
|
private readonly AcceptableSizeSpecification _acceptableSizeSpecification;
|
|
|
|
private readonly AlreadyInQueueSpecification _alreadyInQueueSpecification;
|
|
|
|
private readonly AlreadyInQueueSpecification _alreadyInQueueSpecification;
|
|
|
|
private readonly RetentionSpecification _retentionSpecification;
|
|
|
|
private readonly RetentionSpecification _retentionSpecification;
|
|
|
|
|
|
|
|
private readonly AllowedReleaseGroupSpecification _allowedReleaseGroupSpecification;
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
[Inject]
|
|
|
|
public AllowedDownloadSpecification(QualityAllowedByProfileSpecification qualityAllowedByProfileSpecification,
|
|
|
|
public AllowedDownloadSpecification(QualityAllowedByProfileSpecification qualityAllowedByProfileSpecification,
|
|
|
|
UpgradeDiskSpecification upgradeDiskSpecification, AcceptableSizeSpecification acceptableSizeSpecification,
|
|
|
|
UpgradeDiskSpecification upgradeDiskSpecification, AcceptableSizeSpecification acceptableSizeSpecification,
|
|
|
|
AlreadyInQueueSpecification alreadyInQueueSpecification, RetentionSpecification retentionSpecification)
|
|
|
|
AlreadyInQueueSpecification alreadyInQueueSpecification, RetentionSpecification retentionSpecification,
|
|
|
|
|
|
|
|
AllowedReleaseGroupSpecification allowedReleaseGroupSpecification)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_qualityAllowedByProfileSpecification = qualityAllowedByProfileSpecification;
|
|
|
|
_qualityAllowedByProfileSpecification = qualityAllowedByProfileSpecification;
|
|
|
|
_upgradeDiskSpecification = upgradeDiskSpecification;
|
|
|
|
_upgradeDiskSpecification = upgradeDiskSpecification;
|
|
|
|
_acceptableSizeSpecification = acceptableSizeSpecification;
|
|
|
|
_acceptableSizeSpecification = acceptableSizeSpecification;
|
|
|
|
_alreadyInQueueSpecification = alreadyInQueueSpecification;
|
|
|
|
_alreadyInQueueSpecification = alreadyInQueueSpecification;
|
|
|
|
_retentionSpecification = retentionSpecification;
|
|
|
|
_retentionSpecification = retentionSpecification;
|
|
|
|
|
|
|
|
_allowedReleaseGroupSpecification = allowedReleaseGroupSpecification;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AllowedDownloadSpecification()
|
|
|
|
public AllowedDownloadSpecification()
|
|
|
@ -37,8 +40,9 @@ namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter;
|
|
|
|
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter;
|
|
|
|
if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Retention;
|
|
|
|
if (!_retentionSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Retention;
|
|
|
|
if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Size;
|
|
|
|
if (!_acceptableSizeSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.Size;
|
|
|
|
|
|
|
|
if (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ReleaseGroupNotWanted;
|
|
|
|
if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AlreadyInQueue;
|
|
|
|
if (_alreadyInQueueSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AlreadyInQueue;
|
|
|
|
|
|
|
|
|
|
|
|
logger.Debug("Episode {0} is needed", subject);
|
|
|
|
logger.Debug("Episode {0} is needed", subject);
|
|
|
|
return ReportRejectionType.None;
|
|
|
|
return ReportRejectionType.None;
|
|
|
|
}
|
|
|
|
}
|
|
|
|