From 5727e7c43be65a8b382c8eee03e8faee6629d1c5 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 22 Apr 2023 20:23:55 -0500 Subject: [PATCH] New: Improve accepted and rejected release logging Closes #8236 Co-Authored-By: Mark McDowall --- .../DecisionEngine/DownloadDecisionMaker.cs | 4 ++-- .../Specifications/UpgradableSpecification.cs | 20 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index de04eab8e..c7b48c407 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -141,11 +141,11 @@ namespace NzbDrone.Core.DecisionEngine { if (decision.Rejections.Any()) { - _logger.Debug("Release rejected for the following reasons: {0}", string.Join(", ", decision.Rejections)); + _logger.Debug("Release '{0}' from '{1}' rejected for the following reasons: {2}", report.Title, report.Indexer, string.Join(", ", decision.Rejections)); } else { - _logger.Debug("Release accepted"); + _logger.Debug("Release '{0}' from '{1}' accepted", report.Title, report.Indexer); } yield return decision; diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs index 782559e80..a6e4f9c53 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradableSpecification.cs @@ -36,13 +36,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications if (qualityCompare > 0) { - _logger.Debug("New item has a better quality"); + _logger.Debug("New item has a better quality. Existing: {0}. New: {1}", currentQuality, newQuality); return true; } if (qualityCompare < 0) { - _logger.Debug("Existing item has better quality, skipping"); + _logger.Debug("Existing item has better quality, skipping. Existing: {0}. New: {1}", currentQuality, newQuality); return false; } @@ -53,6 +53,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer && qualityRevisionCompare > 0) { + _logger.Debug("New item has a better quality revision, skipping. Existing: {0}. New: {1}", currentQuality, newQuality); return true; } @@ -63,19 +64,21 @@ namespace NzbDrone.Core.DecisionEngine.Specifications if (downloadPropersAndRepacks != ProperDownloadTypes.DoNotPrefer && qualityRevisionCompare < 0) { - _logger.Debug("Existing item has a better quality revision, skipping"); + _logger.Debug("Existing item has a better quality revision, skipping. Existing: {0}. New: {1}", currentQuality, newQuality); return false; } if (newFormatScore <= currentFormatScore) { - _logger.Debug("New item's custom formats [{0}] do not improve on [{1}], skipping", + _logger.Debug("New item's custom formats [{0}] ({1}) do not improve on [{2}] ({3}), skipping", newCustomFormats.ConcatToString(), - currentCustomFormats.ConcatToString()); + newFormatScore, + currentCustomFormats.ConcatToString(), + currentFormatScore); return false; } - _logger.Debug("New item has a custom format upgrade"); + _logger.Debug("New item has a better custom format score"); return true; } @@ -115,7 +118,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications return true; } - _logger.Debug("Existing item meets cut-off. skipping."); + _logger.Debug("Existing item meets cut-off. skipping. Existing: {0}", currentQuality); return false; } @@ -124,9 +127,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications { var compare = newQuality.Revision.CompareTo(currentQuality.Revision); + // Comparing the quality directly because we don't want to upgrade to a proper for a webrip from a webdl or vice versa if (currentQuality.Quality == newQuality.Quality && compare > 0) { - _logger.Debug("New quality is a better revision for existing quality"); + _logger.Debug("New quality is a better revision for existing quality. Existing: {0}. New: {1}", currentQuality, newQuality); return true; }