1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-28 08:58:41 +02:00

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

View File

@ -37,7 +37,8 @@ public PagingSpec<Episode> EpisodesWhereCutoffUnmet(PagingSpec<Episode> pagingSp
//Get all items less than the cutoff
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();
if (belowCutoff.Any())
@ -48,7 +49,8 @@ public PagingSpec<Episode> EpisodesWhereCutoffUnmet(PagingSpec<Episode> pagingSp
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();
if (belowLanguageCutoff.Any())