Fixed: Cutoff Unmet showing items above lowest accepted quality when upgrades are disabled

This commit is contained in:
Mark McDowall 2022-05-22 16:44:12 -07:00
parent 6a7d84f134
commit d48950ec3c
1 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,8 @@ namespace NzbDrone.Core.Tv
//Get all items less than the cutoff //Get all items less than the cutoff
foreach (var profile in profiles) foreach (var profile in profiles)
{ {
var cutoffIndex = profile.GetIndex(profile.Cutoff); var cutoff = profile.UpgradeAllowed ? profile.Cutoff : profile.FirststAllowedQuality().Id;
var cutoffIndex = profile.GetIndex(cutoff);
var belowCutoff = profile.Items.Take(cutoffIndex.Index).ToList(); var belowCutoff = profile.Items.Take(cutoffIndex.Index).ToList();
if (belowCutoff.Any()) if (belowCutoff.Any())
@ -48,7 +49,8 @@ namespace NzbDrone.Core.Tv
foreach (var profile in languageProfiles) foreach (var profile in languageProfiles)
{ {
var languageCutoffIndex = profile.Languages.FindIndex(v => v.Language == profile.Cutoff); var languageCutoff = profile.UpgradeAllowed ? profile.Cutoff : profile.FirstAllowedLanguage();
var languageCutoffIndex = profile.Languages.FindIndex(v => v.Language == languageCutoff);
var belowLanguageCutoff = profile.Languages.Take(languageCutoffIndex).ToList(); var belowLanguageCutoff = profile.Languages.Take(languageCutoffIndex).ToList();
if (belowLanguageCutoff.Any()) if (belowLanguageCutoff.Any())