From b29dee63f4b493c1e5e28a240bb05155bd7ff199 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 4 Oct 2024 19:50:49 +0300 Subject: [PATCH] Use the first allowed quality for cutoff met rejection message with disabled upgrades --- .../Specifications/UpgradeDiskSpecification.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs index ae7ea369f..f44249d34 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs @@ -37,6 +37,7 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se } file.Movie = subject.Movie; + var customFormats = _formatService.ParseCustomFormat(file); _logger.Debug("Comparing file quality with report. Existing file is {0} [{1}].", file.Quality, customFormats.ConcatToString()); @@ -48,8 +49,8 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se { _logger.Debug("Cutoff already met, rejecting."); - var qualityCutoffIndex = qualityProfile.GetIndex(qualityProfile.Cutoff); - var qualityCutoff = qualityProfile.Items[qualityCutoffIndex.Index]; + var cutoff = qualityProfile.UpgradeAllowed ? qualityProfile.Cutoff : qualityProfile.FirststAllowedQuality().Id; + var qualityCutoff = qualityProfile.Items[qualityProfile.GetIndex(cutoff).Index]; return Decision.Reject("Existing file meets cutoff: {0} [{1}]", qualityCutoff, customFormats.ConcatToString()); }