1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

Use the first allowed quality for cutoff met rejection message with disabled upgrades

This commit is contained in:
Bogdan 2024-10-04 19:50:49 +03:00 committed by Mark McDowall
parent a001216957
commit c8f419b014

View File

@ -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,