|
|
@ -14,12 +14,14 @@ namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
private readonly RetentionSpecification _retentionSpecification;
|
|
|
|
private readonly RetentionSpecification _retentionSpecification;
|
|
|
|
private readonly AllowedReleaseGroupSpecification _allowedReleaseGroupSpecification;
|
|
|
|
private readonly AllowedReleaseGroupSpecification _allowedReleaseGroupSpecification;
|
|
|
|
private readonly CustomStartDateSpecification _customStartDateSpecification;
|
|
|
|
private readonly CustomStartDateSpecification _customStartDateSpecification;
|
|
|
|
|
|
|
|
private readonly LanguageSpecification _languageSpecification;
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
|
|
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, CustomStartDateSpecification customStartDateSpecification)
|
|
|
|
AllowedReleaseGroupSpecification allowedReleaseGroupSpecification, CustomStartDateSpecification customStartDateSpecification,
|
|
|
|
|
|
|
|
LanguageSpecification languageSpecification)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_qualityAllowedByProfileSpecification = qualityAllowedByProfileSpecification;
|
|
|
|
_qualityAllowedByProfileSpecification = qualityAllowedByProfileSpecification;
|
|
|
|
_upgradeDiskSpecification = upgradeDiskSpecification;
|
|
|
|
_upgradeDiskSpecification = upgradeDiskSpecification;
|
|
|
@ -28,6 +30,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
_retentionSpecification = retentionSpecification;
|
|
|
|
_retentionSpecification = retentionSpecification;
|
|
|
|
_allowedReleaseGroupSpecification = allowedReleaseGroupSpecification;
|
|
|
|
_allowedReleaseGroupSpecification = allowedReleaseGroupSpecification;
|
|
|
|
_customStartDateSpecification = customStartDateSpecification;
|
|
|
|
_customStartDateSpecification = customStartDateSpecification;
|
|
|
|
|
|
|
|
_languageSpecification = languageSpecification;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AllowedDownloadSpecification()
|
|
|
|
public AllowedDownloadSpecification()
|
|
|
@ -39,6 +42,7 @@ namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
if (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.QualityNotWanted;
|
|
|
|
if (!_qualityAllowedByProfileSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.QualityNotWanted;
|
|
|
|
if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AiredAfterCustomStartDate;
|
|
|
|
if (!_customStartDateSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.AiredAfterCustomStartDate;
|
|
|
|
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter;
|
|
|
|
if (!_upgradeDiskSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ExistingQualityIsEqualOrBetter;
|
|
|
|
|
|
|
|
if (!_languageSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.LanguageNotWanted;
|
|
|
|
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 (!_allowedReleaseGroupSpecification.IsSatisfiedBy(subject)) return ReportRejectionType.ReleaseGroupNotWanted;
|
|
|
|