From c8f419b014857d262b15b68e5016633e09352d31 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs index 86d9edcb2..c7afa3351 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs @@ -36,8 +36,6 @@ namespace NzbDrone.Core.DecisionEngine.Specifications continue; } - var customFormats = _formatService.ParseCustomFormat(file); - _logger.Debug("Comparing file quality with report. Existing file is {0}.", file.Quality); if (!_upgradableSpecification.CutoffNotMet(qualityProfile, @@ -47,12 +45,14 @@ namespace NzbDrone.Core.DecisionEngine.Specifications { _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}", qualityCutoff); } + var customFormats = _formatService.ParseCustomFormat(file); + var upgradeableRejectReason = _upgradableSpecification.IsUpgradable(qualityProfile, file.Quality, customFormats,