mirror of
https://github.com/Lidarr/Lidarr
synced 2025-12-07 17:05:19 +01:00
Add logging for custom format score above minimum
(cherry picked from commit 87934c77614a60e2f53cf9dbeb553b0a4928977a)
This commit is contained in:
parent
56480c7c0a
commit
d45b8cf1c7
1 changed files with 9 additions and 0 deletions
|
|
@ -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 @@ public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase se
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue