diff --git a/src/NzbDrone.Api/Config/IndexerConfigModule.cs b/src/NzbDrone.Api/Config/IndexerConfigModule.cs index 073a1d505..1f7ff674c 100644 --- a/src/NzbDrone.Api/Config/IndexerConfigModule.cs +++ b/src/NzbDrone.Api/Config/IndexerConfigModule.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Api.Config : base(configService) { SharedValidator.RuleFor(c => c.MinimumAge) - .GreaterThan(0); + .GreaterThanOrEqualTo(0); SharedValidator.RuleFor(c => c.Retention) .GreaterThanOrEqualTo(0); diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs index 36da39acb..a46b3f0fc 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs @@ -29,14 +29,23 @@ namespace NzbDrone.Core.DecisionEngine.Specifications var age = subject.Release.AgeMinutes; var minimumAge = _configService.MinimumAge; + if (minimumAge == 0) + { + _logger.Debug("Minimum age is not set."); + return Decision.Accept(); + } + + _logger.Debug("Checking if report meets minimum age requirements. {0}", age); - if (minimumAge > 0 && age < minimumAge) + if (age < minimumAge) { _logger.Debug("Only {0} minutes old, minimum age is {1} minutes", age, minimumAge); return Decision.Reject("Only {0} minutes old, minimum age is {1} minutes", age, minimumAge); } + _logger.Debug("Release is {0} minutes old, greater than minimum age of {1} minutes", age, minimumAge); + return Decision.Accept(); } } diff --git a/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs b/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs index fa3d45be2..14fc7f5bb 100644 --- a/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs +++ b/src/UI/Settings/Indexers/Options/IndexerOptionsViewTemplate.hbs @@ -5,7 +5,7 @@