Fixed: Show rounded age in minimum age rejection message

pull/110/head
Qstick 7 years ago
parent d8adc3f480
commit b88d4aad0e

@ -1,3 +1,4 @@
using System;
using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -29,6 +30,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
var age = subject.Release.AgeMinutes;
var minimumAge = _configService.MinimumAge;
var ageRounded = Math.Round(age, 1);
if (minimumAge == 0)
{
@ -37,15 +39,15 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
}
_logger.Debug("Checking if report meets minimum age requirements. {0}", age);
_logger.Debug("Checking if report meets minimum age requirements. {0}", ageRounded);
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("Only {0} minutes old, minimum age is {1} minutes", ageRounded, minimumAge);
return Decision.Reject("Only {0} minutes old, minimum age is {1} minutes", ageRounded, minimumAge);
}
_logger.Debug("Release is {0} minutes old, greater than minimum age of {1} minutes", age, minimumAge);
_logger.Debug("Release is {0} minutes old, greater than minimum age of {1} minutes", ageRounded, minimumAge);
return Decision.Accept();
}

Loading…
Cancel
Save