mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
Fixed: Cutoff Unmet showing items above lowest accepted quality when upgrades are disabled
(cherry picked from commit c1e5b7f642d03414f7c5587d4db377ef979f2067) Fixes #7301 Fixes #7305
This commit is contained in:
parent
f80272a659
commit
79cd2b2346
@ -31,7 +31,8 @@ public PagingSpec<Movie> MoviesWhereCutoffUnmet(PagingSpec<Movie> pagingSpec)
|
|||||||
//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())
|
||||||
|
@ -303,13 +303,25 @@ public MovieFileResource EnsureMovieFile(MovieResource movie, Quality quality)
|
|||||||
return result.MovieFile;
|
return result.MovieFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QualityProfileResource EnsureProfileCutoff(int profileId, Quality cutoff)
|
public QualityProfileResource EnsureProfileCutoff(int profileId, Quality cutoff, bool upgradeAllowed)
|
||||||
{
|
{
|
||||||
|
var needsUpdate = false;
|
||||||
var profile = Profiles.Get(profileId);
|
var profile = Profiles.Get(profileId);
|
||||||
|
|
||||||
if (profile.Cutoff != cutoff.Id)
|
if (profile.Cutoff != cutoff.Id)
|
||||||
{
|
{
|
||||||
profile.Cutoff = cutoff.Id;
|
profile.Cutoff = cutoff.Id;
|
||||||
|
needsUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.UpgradeAllowed != upgradeAllowed)
|
||||||
|
{
|
||||||
|
profile.UpgradeAllowed = upgradeAllowed;
|
||||||
|
needsUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsUpdate)
|
||||||
|
{
|
||||||
profile = Profiles.Put(profile);
|
profile = Profiles.Put(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user