You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
5 years ago
|
#pragma warning disable CS1591
|
||
|
|
||
6 years ago
|
using System.Collections.Generic;
|
||
10 years ago
|
using System.Linq;
|
||
5 years ago
|
using System.Text.Json.Serialization;
|
||
5 years ago
|
using Jellyfin.Data.Entities;
|
||
8 years ago
|
using MediaBrowser.Controller.Entities;
|
||
|
using MediaBrowser.Controller.Playlists;
|
||
8 years ago
|
using MediaBrowser.Model.Querying;
|
||
10 years ago
|
|
||
7 years ago
|
namespace Emby.Server.Implementations.Playlists
|
||
10 years ago
|
{
|
||
|
public class PlaylistsFolder : BasePluginFolder
|
||
|
{
|
||
|
public PlaylistsFolder()
|
||
|
{
|
||
|
Name = "Playlists";
|
||
|
}
|
||
|
|
||
3 years ago
|
[JsonIgnore]
|
||
|
public override bool IsHidden => true;
|
||
|
|
||
|
[JsonIgnore]
|
||
|
public override bool SupportsInheritedParentImages => false;
|
||
|
|
||
|
[JsonIgnore]
|
||
|
public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists;
|
||
|
|
||
5 years ago
|
public override bool IsVisible(User user)
|
||
10 years ago
|
{
|
||
8 years ago
|
return base.IsVisible(user) && GetChildren(user, true).Any();
|
||
10 years ago
|
}
|
||
|
|
||
5 years ago
|
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
||
10 years ago
|
{
|
||
8 years ago
|
return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>();
|
||
10 years ago
|
}
|
||
|
|
||
8 years ago
|
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||
8 years ago
|
{
|
||
6 years ago
|
if (query.User == null)
|
||
|
{
|
||
|
query.Recursive = false;
|
||
|
return base.GetItemsInternal(query);
|
||
|
}
|
||
|
|
||
|
query.Recursive = true;
|
||
5 years ago
|
query.IncludeItemTypes = new[] { "Playlist" };
|
||
6 years ago
|
query.Parent = null;
|
||
|
return LibraryManager.GetItemsResult(query);
|
||
8 years ago
|
}
|
||
4 years ago
|
|
||
|
public override string GetClientTypeName()
|
||
|
{
|
||
|
return "ManualPlaylistsFolder";
|
||
|
}
|
||
10 years ago
|
}
|
||
|
}
|