This commit is contained in:
@@ -10,6 +10,7 @@ using MediaBrowser.Model.Entities;
|
|||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using CinemaLib.API;
|
using CinemaLib.API;
|
||||||
|
using Jellyfin.Data.Entities;
|
||||||
|
|
||||||
namespace Jellyfin.Plugin.Cinema;
|
namespace Jellyfin.Plugin.Cinema;
|
||||||
|
|
||||||
@@ -27,41 +28,14 @@ public abstract class CinemaRootFolder : CinemaFilterFolder, ICollectionFolder
|
|||||||
public abstract CollectionType? CollectionType { get; }
|
public abstract CollectionType? CollectionType { get; }
|
||||||
|
|
||||||
public override bool IsHidden => _hidden;
|
public override bool IsHidden => _hidden;
|
||||||
|
public override bool IsVisible(User user) => !_hidden;
|
||||||
|
|
||||||
internal bool Hide
|
internal bool Hide
|
||||||
{
|
{
|
||||||
get => _hidden;
|
get => _hidden;
|
||||||
set
|
set => _hidden = value;
|
||||||
{
|
|
||||||
var a = CinemaHost.LibraryManager.RootFolder.VirtualChildren;
|
|
||||||
if (a.Contains(this) == (!value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
this._hidden = value;
|
|
||||||
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
// Remove ourselves
|
|
||||||
var temp = new List<BaseItem>();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
public Task<DynamicImageResponse> GetChannelImage(ImageType type, CancellationToken cancellationToken)
|
public Task<DynamicImageResponse> GetChannelImage(ImageType type, CancellationToken cancellationToken)
|
||||||
|
|||||||
Reference in New Issue
Block a user