Add logging for custom format score above minimum
(cherry picked from commit 87934c77614a60e2f53cf9dbeb553b0a4928977a)
This commit is contained in:
+9
@@ -1,3 +1,4 @@
|
|||||||
|
using NLog;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||||
using NzbDrone.Core.Parser.Model;
|
using NzbDrone.Core.Parser.Model;
|
||||||
@@ -6,9 +7,15 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
{
|
{
|
||||||
public class CustomFormatAllowedbyProfileSpecification : IDecisionEngineSpecification
|
public class CustomFormatAllowedbyProfileSpecification : IDecisionEngineSpecification
|
||||||
{
|
{
|
||||||
|
private readonly Logger _logger;
|
||||||
public SpecificationPriority Priority => SpecificationPriority.Default;
|
public SpecificationPriority Priority => SpecificationPriority.Default;
|
||||||
public RejectionType Type => RejectionType.Permanent;
|
public RejectionType Type => RejectionType.Permanent;
|
||||||
|
|
||||||
|
public CustomFormatAllowedbyProfileSpecification(Logger logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria)
|
public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria)
|
||||||
{
|
{
|
||||||
var minScore = subject.Artist.QualityProfile.Value.MinFormatScore;
|
var minScore = subject.Artist.QualityProfile.Value.MinFormatScore;
|
||||||
@@ -19,6 +26,8 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
return Decision.Reject("Custom Formats {0} have score {1} below Artist profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
|
return Decision.Reject("Custom Formats {0} have score {1} below Artist profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.Trace("Custom Format Score of {0} [{1}] above Artist profile minimum {2}", score, subject.CustomFormats.ConcatToString(), minScore);
|
||||||
|
|
||||||
return Decision.Accept();
|
return Decision.Accept();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user