aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Playlists
diff options
context:
space:
mode:
authorShadowghost <Shadowghost@users.noreply.github.com>2026-09-15 11:15:46 -0400
committerCody Robibero <cody@robibe.ro>2026-09-15 11:15:46 -0400
commit006ecadbe041ea422b34adf6a3fcf6638d189a70 (patch)
treec845d30aafd6cb23bf2e41dd955712db0f641ce4 /MediaBrowser.Controller/Playlists
parent65bc888b07a25d1883d4d0a2f55a7f3e1ac35c87 (diff)
Backport pull request #17881 from jellyfin/release-12.z
Fix /UserViews exhausting memory and reporting random child counts Original-merge: a838a06aa51eac388a76e9e6421f1a80873c417b Merged-by: crobibero <cody@robibe.ro> Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'MediaBrowser.Controller/Playlists')
-rw-r--r--MediaBrowser.Controller/Playlists/Playlist.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs
index fc367b8293..edf3fb25c9 100644
--- a/MediaBrowser.Controller/Playlists/Playlist.cs
+++ b/MediaBrowser.Controller/Playlists/Playlist.cs
@@ -235,18 +235,18 @@ namespace MediaBrowser.Controller.Playlists
{
if (!IsSharedItem)
{
- return base.IsVisible(user, skipAllowedTagsCheck);
+ return base.IsVisible(user, skipAllowedTagsCheck) && HasParentalAllowedChild(user);
}
if (OpenAccess)
{
- return true;
+ return HasParentalAllowedChild(user);
}
var userId = user.Id;
if (userId.Equals(OwnerUserId))
{
- return true;
+ return HasParentalAllowedChild(user);
}
var shares = Shares;
@@ -255,7 +255,19 @@ namespace MediaBrowser.Controller.Playlists
return false;
}
- return shares.Any(s => s.UserId.Equals(userId));
+ return shares.Any(s => s.UserId.Equals(userId)) && HasParentalAllowedChild(user);
+ }
+
+ private bool HasParentalAllowedChild(User user)
+ {
+ if (!user.MaxParentalRatingScore.HasValue)
+ {
+ return true;
+ }
+
+ var linkedItems = GetLinkedChildren();
+
+ return linkedItems.Count == 0 || linkedItems.Any(child => child.IsParentalAllowed(user, true));
}
public override bool CanDelete(User user)