mirror of
https://github.com/Radarr/Radarr
synced 2025-01-01 12:54:21 +00:00
Improvements for minimum age
This commit is contained in:
parent
580f03a5bc
commit
bf169eb139
3 changed files with 12 additions and 3 deletions
|
@ -10,7 +10,7 @@ public IndexerConfigModule(IConfigService configService)
|
|||
: base(configService)
|
||||
{
|
||||
SharedValidator.RuleFor(c => c.MinimumAge)
|
||||
.GreaterThan(0);
|
||||
.GreaterThanOrEqualTo(0);
|
||||
|
||||
SharedValidator.RuleFor(c => c.Retention)
|
||||
.GreaterThanOrEqualTo(0);
|
||||
|
|
|
@ -29,14 +29,23 @@ public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<label class="col-sm-3 control-label">Minimum Age</label>
|
||||
|
||||
<div class="col-sm-1 col-sm-push-2 help-inline">
|
||||
<i class="icon-nd-form-info" title="Usenet only: Reports that do not meet minimum age will not be grabbed, until they do"/>
|
||||
<i class="icon-nd-form-info" title="Usenet only: Minimum age of NZBs before they are grabbed. Use this to give new releases time to propagate to your usenet provider."/>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 col-sm-pull-1">
|
||||
|
|
Loading…
Reference in a new issue