mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Add block unrated option
This commit is contained in:
@@ -1072,6 +1072,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
if (user.Configuration.BlockNotRated && string.IsNullOrEmpty(CustomRating ?? OfficialRating))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Ratings.Level(CustomRating ?? OfficialRating) <= user.Configuration.MaxParentalRating.Value;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,21 @@ namespace MediaBrowser.Controller.Entities
|
||||
await LibraryManager.SaveChildren(Id, newChildren, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Never want folders to be blocked by "BlockNotRated"
|
||||
/// </summary>
|
||||
public override string OfficialRating
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(base.OfficialRating) ? base.OfficialRating : "None";
|
||||
}
|
||||
set
|
||||
{
|
||||
base.OfficialRating = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the child.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user