Fixed: Show rounded age in minimum age rejection message

Fixes #2003
Mark McDowall 8 years ago
parent 63860e783e
commit 60231fbcae
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0

@ -1,4 +1,5 @@
using NLog;
using System;
using NLog;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
@ -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