mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
update data queries
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
|
||||
namespace MediaBrowser.Controller.Playlists
|
||||
@@ -81,7 +82,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
public override IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
{
|
||||
return GetPlayableItems(user).Result;
|
||||
return GetPlayableItems(user, new DtoOptions(true)).Result;
|
||||
}
|
||||
|
||||
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||
@@ -91,7 +92,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
public override IEnumerable<BaseItem> GetRecursiveChildren(User user, InternalItemsQuery query)
|
||||
{
|
||||
var items = GetPlayableItems(user).Result;
|
||||
var items = GetPlayableItems(user, query.DtoOptions).Result;
|
||||
|
||||
if (query != null)
|
||||
{
|
||||
@@ -106,12 +107,12 @@ namespace MediaBrowser.Controller.Playlists
|
||||
return GetLinkedChildrenInfos();
|
||||
}
|
||||
|
||||
private Task<IEnumerable<BaseItem>> GetPlayableItems(User user)
|
||||
private Task<IEnumerable<BaseItem>> GetPlayableItems(User user, DtoOptions options)
|
||||
{
|
||||
return GetPlaylistItems(MediaType, base.GetChildren(user, true), user);
|
||||
return GetPlaylistItems(MediaType, base.GetChildren(user, true), user, options);
|
||||
}
|
||||
|
||||
public static async Task<IEnumerable<BaseItem>> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user)
|
||||
public static async Task<IEnumerable<BaseItem>> GetPlaylistItems(string playlistMediaType, IEnumerable<BaseItem> inputItems, User user, DtoOptions options)
|
||||
{
|
||||
if (user != null)
|
||||
{
|
||||
@@ -122,14 +123,14 @@ namespace MediaBrowser.Controller.Playlists
|
||||
|
||||
foreach (var item in inputItems)
|
||||
{
|
||||
var playlistItems = await GetPlaylistItems(item, user, playlistMediaType).ConfigureAwait(false);
|
||||
var playlistItems = await GetPlaylistItems(item, user, playlistMediaType, options).ConfigureAwait(false);
|
||||
list.AddRange(playlistItems);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static async Task<IEnumerable<BaseItem>> GetPlaylistItems(BaseItem item, User user, string mediaType)
|
||||
private static async Task<IEnumerable<BaseItem>> GetPlaylistItems(BaseItem item, User user, string mediaType, DtoOptions options)
|
||||
{
|
||||
var musicGenre = item as MusicGenre;
|
||||
if (musicGenre != null)
|
||||
@@ -140,7 +141,8 @@ namespace MediaBrowser.Controller.Playlists
|
||||
IncludeItemTypes = new[] { typeof(Audio).Name },
|
||||
GenreIds = new[] { musicGenre.Id.ToString("N") },
|
||||
SortBy = new[] { ItemSortBy.AlbumArtist, ItemSortBy.Album, ItemSortBy.SortName },
|
||||
SortOrder = SortOrder.Ascending
|
||||
SortOrder = SortOrder.Ascending,
|
||||
DtoOptions = options
|
||||
});
|
||||
}
|
||||
|
||||
@@ -153,7 +155,8 @@ namespace MediaBrowser.Controller.Playlists
|
||||
IncludeItemTypes = new[] { typeof(Audio).Name },
|
||||
ArtistIds = new[] { musicArtist.Id.ToString("N") },
|
||||
SortBy = new[] { ItemSortBy.AlbumArtist, ItemSortBy.Album, ItemSortBy.SortName },
|
||||
SortOrder = SortOrder.Ascending
|
||||
SortOrder = SortOrder.Ascending,
|
||||
DtoOptions = options
|
||||
});
|
||||
}
|
||||
|
||||
@@ -166,7 +169,8 @@ namespace MediaBrowser.Controller.Playlists
|
||||
IsFolder = false,
|
||||
SortBy = new[] { ItemSortBy.SortName },
|
||||
MediaTypes = new[] { mediaType },
|
||||
EnableTotalRecordCount = false
|
||||
EnableTotalRecordCount = false,
|
||||
DtoOptions = options
|
||||
};
|
||||
|
||||
var itemsResult = await folder.GetItems(query).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user