1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-22 16:02:43 +00: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
parent f6542bab0a
commit b29dee63f4

View file

@ -37,6 +37,7 @@ public virtual Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase se
} }
file.Movie = subject.Movie; file.Movie = subject.Movie;
var customFormats = _formatService.ParseCustomFormat(file); var customFormats = _formatService.ParseCustomFormat(file);
_logger.Debug("Comparing file quality with report. Existing file is {0} [{1}].", file.Quality, customFormats.ConcatToString()); _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."); _logger.Debug("Cutoff already met, rejecting.");
var qualityCutoffIndex = qualityProfile.GetIndex(qualityProfile.Cutoff); var cutoff = qualityProfile.UpgradeAllowed ? qualityProfile.Cutoff : qualityProfile.FirststAllowedQuality().Id;
var qualityCutoff = qualityProfile.Items[qualityCutoffIndex.Index]; var qualityCutoff = qualityProfile.Items[qualityProfile.GetIndex(cutoff).Index];
return Decision.Reject("Existing file meets cutoff: {0} [{1}]", qualityCutoff, customFormats.ConcatToString()); return Decision.Reject("Existing file meets cutoff: {0} [{1}]", qualityCutoff, customFormats.ConcatToString());
} }