diff --git a/CinemaJellyfin/CinemaRootFolder.cs b/CinemaJellyfin/CinemaRootFolder.cs index 2b60f08..2f5a31d 100644 --- a/CinemaJellyfin/CinemaRootFolder.cs +++ b/CinemaJellyfin/CinemaRootFolder.cs @@ -10,6 +10,7 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; using Microsoft.Extensions.Logging; using CinemaLib.API; +using Jellyfin.Data.Entities; namespace Jellyfin.Plugin.Cinema; @@ -27,41 +28,14 @@ public abstract class CinemaRootFolder : CinemaFilterFolder, ICollectionFolder public abstract CollectionType? CollectionType { get; } public override bool IsHidden => _hidden; + public override bool IsVisible(User user) => !_hidden; internal bool Hide { get => _hidden; - set - { - var a = CinemaHost.LibraryManager.RootFolder.VirtualChildren; - if (a.Contains(this) == (!value)) - return; - - this._hidden = value; - - if (value) - { - // Remove ourselves - var temp = new List(); - while (!a.IsEmpty) - { - if (!a.TryTake(out BaseItem? b)) - continue; - - if (b == this) - break; - temp.Add(b); - } - foreach (var i in temp) - a.Add(i); - } - else - // Add ourselves - a.Add(this); - } + set => _hidden = value; } - /* public Task GetChannelImage(ImageType type, CancellationToken cancellationToken)