mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
Additional logging for custom format score
This commit is contained in:
@@ -117,6 +117,8 @@ namespace NzbDrone.Core.DecisionEngine
|
|||||||
remoteEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(remoteEpisode, remoteEpisode.Release.Size);
|
remoteEpisode.CustomFormats = _formatCalculator.ParseCustomFormat(remoteEpisode, remoteEpisode.Release.Size);
|
||||||
remoteEpisode.CustomFormatScore = remoteEpisode?.Series?.QualityProfile?.Value.CalculateCustomFormatScore(remoteEpisode.CustomFormats) ?? 0;
|
remoteEpisode.CustomFormatScore = remoteEpisode?.Series?.QualityProfile?.Value.CalculateCustomFormatScore(remoteEpisode.CustomFormats) ?? 0;
|
||||||
|
|
||||||
|
_logger.Trace("Custom Format Score of '{0}' [{1}] calculated for '{2}'", remoteEpisode.CustomFormatScore, remoteEpisode.CustomFormats?.ConcatToString(), report.Title);
|
||||||
|
|
||||||
remoteEpisode.DownloadAllowed = remoteEpisode.Episodes.Any();
|
remoteEpisode.DownloadAllowed = remoteEpisode.Episodes.Any();
|
||||||
decision = GetDecisionForReport(remoteEpisode, searchCriteria);
|
decision = GetDecisionForReport(remoteEpisode, searchCriteria);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,6 +7,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
{
|
{
|
||||||
public class CustomFormatAllowedbyProfileSpecification : IDownloadDecisionEngineSpecification
|
public class CustomFormatAllowedbyProfileSpecification : IDownloadDecisionEngineSpecification
|
||||||
{
|
{
|
||||||
|
private readonly Logger _logger;
|
||||||
|
|
||||||
|
public CustomFormatAllowedbyProfileSpecification(Logger logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
public SpecificationPriority Priority => SpecificationPriority.Default;
|
public SpecificationPriority Priority => SpecificationPriority.Default;
|
||||||
public RejectionType Type => RejectionType.Permanent;
|
public RejectionType Type => RejectionType.Permanent;
|
||||||
|
|
||||||
@@ -19,6 +27,8 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||||||
return DownloadSpecDecision.Reject(DownloadRejectionReason.CustomFormatMinimumScore, "Custom Formats {0} have score {1} below Series profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
|
return DownloadSpecDecision.Reject(DownloadRejectionReason.CustomFormatMinimumScore, "Custom Formats {0} have score {1} below Series profile minimum {2}", subject.CustomFormats.ConcatToString(), score, minScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.Trace("Custom Format Score of {0} [{1}] above Series profile minumum {2}", score, subject.CustomFormats.ConcatToString(), minScore);
|
||||||
|
|
||||||
return DownloadSpecDecision.Accept();
|
return DownloadSpecDecision.Accept();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user