diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs index 4cc17dd0fc..9f98a78c2f 100644 --- a/Jellyfin.Api/Controllers/LibraryController.cs +++ b/Jellyfin.Api/Controllers/LibraryController.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Jellyfin.Api.Attributes; using Jellyfin.Api.Constants; using Jellyfin.Api.Extensions; +using Jellyfin.Api.Helpers; using Jellyfin.Api.ModelBinders; using Jellyfin.Api.Models.LibraryDtos; using Jellyfin.Data.Entities; @@ -498,6 +499,12 @@ namespace Jellyfin.Api.Controllers { var items = _libraryManager.GetUserRootFolder().Children.Concat(_libraryManager.RootFolder.VirtualChildren).OrderBy(i => i.SortName).ToList(); + if (!ClaimHelpers.GetIsApiKey(User) && !User.IsInRole(UserRoles.Administrator)) + { + var user = _userManager.GetUserById(ClaimHelpers.GetUserId(User)!.Value); + items = items.Where(i => i.IsVisible(user)).ToList(); + } + if (isHidden.HasValue) { var val = isHidden.Value;