diff --git a/CHANGELOG.md b/CHANGELOG.md index f0e50333..5754931c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Print date & time log at the end of each completed instance sync (#165). +### Changed + +- Less-verbose console logging for scoreless custom formats. + ### Fixed - Service failures (e.g. HTTP 500) no longer cause exceptions (#206). diff --git a/src/Recyclarr.Cli/Pipelines/QualityProfile/PipelinePhases/QualityProfileConfigPhase.cs b/src/Recyclarr.Cli/Pipelines/QualityProfile/PipelinePhases/QualityProfileConfigPhase.cs index 21e1d50a..bf558f35 100644 --- a/src/Recyclarr.Cli/Pipelines/QualityProfile/PipelinePhases/QualityProfileConfigPhase.cs +++ b/src/Recyclarr.Cli/Pipelines/QualityProfile/PipelinePhases/QualityProfileConfigPhase.cs @@ -12,6 +12,7 @@ public record ProcessedQualityProfileData public required QualityProfileConfig Profile { get; init; } public bool ShouldCreate { get; init; } = true; public IList CfScores { get; init; } = new List(); + public IList ScorelessCfs { get; } = new List(); } public class QualityProfileConfigPhase @@ -64,7 +65,31 @@ public class QualityProfileConfigPhase AddCustomFormatScoreData(profileCfs, profile, cf); } - return allProfiles.Values.ToList(); + var profilesToReturn = allProfiles.Values.ToList(); + PrintDiagnostics(profilesToReturn); + return profilesToReturn; + } + + private void PrintDiagnostics(IEnumerable profiles) + { + var scoreless = profiles + .SelectMany(x => x.ScorelessCfs) + .Select(x => (x.Name, x.TrashId)) + .ToList(); + + if (!scoreless.Any()) + { + return; + } + + _log.Information( + "A total of {Count} custom formats have no scores assigned. See the debug logs for a detailed listing.", + scoreless.Count); + + foreach (var (name, trashId) in scoreless) + { + _log.Debug("CF has no score in the guide or config YAML: {Name} ({TrashId})", name, trashId); + } } private void AddCustomFormatScoreData( @@ -77,7 +102,7 @@ public class QualityProfileConfigPhase var scoreToUse = DetermineScore(profile.Profile, scoreConfig, cf); if (scoreToUse is null) { - _log.Information("No score in guide or config for CF {Name} ({TrashId})", cf.Name, cf.TrashId); + profile.ScorelessCfs.Add(cf); return; }