mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
# Conflicts: # Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs # Emby.Server.Implementations/Library/UserManager.cs # Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs # Emby.Server.Implementations/Sorting/IsPlayedComparer.cs # Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs # Emby.Server.Implementations/TV/TVSeriesManager.cs # Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs
54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
#pragma warning disable CS1591
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text.Json.Serialization;
|
|
using Jellyfin.Data.Entities;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Playlists;
|
|
using MediaBrowser.Model.Querying;
|
|
|
|
namespace Emby.Server.Implementations.Playlists
|
|
{
|
|
public class PlaylistsFolder : BasePluginFolder
|
|
{
|
|
public PlaylistsFolder()
|
|
{
|
|
Name = "Playlists";
|
|
}
|
|
|
|
public override bool IsVisible(User user)
|
|
{
|
|
return base.IsVisible(user) && GetChildren(user, true).Any();
|
|
}
|
|
|
|
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
|
{
|
|
return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>();
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public override bool IsHidden => true;
|
|
|
|
[JsonIgnore]
|
|
public override bool SupportsInheritedParentImages => false;
|
|
|
|
[JsonIgnore]
|
|
public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists;
|
|
|
|
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
|
{
|
|
if (query.User == null)
|
|
{
|
|
query.Recursive = false;
|
|
return base.GetItemsInternal(query);
|
|
}
|
|
|
|
query.Recursive = true;
|
|
query.IncludeItemTypes = new[] { "Playlist" };
|
|
query.Parent = null;
|
|
return LibraryManager.GetItemsResult(query);
|
|
}
|
|
}
|
|
}
|