2020-05-29 05:28:19 -04:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 14:54:44 -05:00
|
|
|
using System.Collections.Generic;
|
2014-08-01 22:34:45 -04:00
|
|
|
using System.Linq;
|
2019-10-15 11:49:49 -04:00
|
|
|
using System.Text.Json.Serialization;
|
2020-05-20 13:07:53 -04:00
|
|
|
using Jellyfin.Data.Entities;
|
2021-12-11 21:31:30 -05:00
|
|
|
using Jellyfin.Data.Enums;
|
2016-11-10 22:29:51 -05:00
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Controller.Playlists;
|
2016-10-12 14:23:09 -04:00
|
|
|
using MediaBrowser.Model.Querying;
|
2014-08-01 22:34:45 -04:00
|
|
|
|
2017-08-16 13:30:16 -04:00
|
|
|
namespace Emby.Server.Implementations.Playlists
|
2014-08-01 22:34:45 -04:00
|
|
|
{
|
|
|
|
public class PlaylistsFolder : BasePluginFolder
|
|
|
|
{
|
|
|
|
public PlaylistsFolder()
|
|
|
|
{
|
|
|
|
Name = "Playlists";
|
|
|
|
}
|
|
|
|
|
2021-09-25 14:32:53 -04:00
|
|
|
[JsonIgnore]
|
|
|
|
public override bool IsHidden => true;
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
public override bool SupportsInheritedParentImages => false;
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists;
|
|
|
|
|
2020-05-20 13:07:53 -04:00
|
|
|
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
|
2014-08-02 22:16:37 -04:00
|
|
|
{
|
2016-08-13 01:49:00 -04:00
|
|
|
return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>();
|
2014-08-01 22:34:45 -04:00
|
|
|
}
|
|
|
|
|
2017-05-26 02:48:54 -04:00
|
|
|
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
2016-10-12 14:23:09 -04:00
|
|
|
{
|
2022-12-05 09:00:20 -05:00
|
|
|
if (query.User is null)
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
query.Recursive = false;
|
|
|
|
return base.GetItemsInternal(query);
|
|
|
|
}
|
|
|
|
|
|
|
|
query.Recursive = true;
|
2021-12-11 21:31:30 -05:00
|
|
|
query.IncludeItemTypes = new[] { BaseItemKind.Playlist };
|
2023-05-26 04:59:49 -04:00
|
|
|
return QueryWithPostFiltering2(query);
|
2016-10-12 14:23:09 -04:00
|
|
|
}
|
2021-02-13 09:28:37 -05:00
|
|
|
|
|
|
|
public override string GetClientTypeName()
|
|
|
|
{
|
|
|
|
return "ManualPlaylistsFolder";
|
|
|
|
}
|
2014-08-01 22:34:45 -04:00
|
|
|
}
|
|
|
|
}
|