fix playlists empty with dlna

pull/702/head
Luke Pulverenti 9 years ago
parent 9ad551c77c
commit abf9809a1d

@ -181,6 +181,11 @@ namespace MediaBrowser.Controller.Entities
public InternalItemsQuery(User user) public InternalItemsQuery(User user)
: this() : this()
{
SetUser(user);
}
public void SetUser(User user)
{ {
if (user != null) if (user != null)
{ {

@ -140,7 +140,7 @@ namespace MediaBrowser.Controller.Entities
return await GetPlaylistsView(queryParent, user, query).ConfigureAwait(false); return await GetPlaylistsView(queryParent, user, query).ConfigureAwait(false);
case CollectionType.BoxSets: case CollectionType.BoxSets:
return await GetBoxsetView(queryParent, user, query).ConfigureAwait(false); return GetBoxsetView(queryParent, user, query);
case CollectionType.TvShows: case CollectionType.TvShows:
return await GetTvView(queryParent, user, query).ConfigureAwait(false); return await GetTvView(queryParent, user, query).ConfigureAwait(false);
@ -206,7 +206,7 @@ namespace MediaBrowser.Controller.Entities
return GetMusicLatest(queryParent, user, query); return GetMusicLatest(queryParent, user, query);
case SpecialFolder.MusicPlaylists: case SpecialFolder.MusicPlaylists:
return await GetMusicPlaylists(queryParent, user, query).ConfigureAwait(false); return GetMusicPlaylists(queryParent, user, query);
case SpecialFolder.MusicAlbums: case SpecialFolder.MusicAlbums:
return GetMusicAlbums(queryParent, user, query); return GetMusicAlbums(queryParent, user, query);
@ -353,12 +353,14 @@ namespace MediaBrowser.Controller.Entities
return GetResult(artists, parent, query); return GetResult(artists, parent, query);
} }
private Task<QueryResult<BaseItem>> GetMusicPlaylists(Folder parent, User user, InternalItemsQuery query) private QueryResult<BaseItem> GetMusicPlaylists(Folder parent, User user, InternalItemsQuery query)
{ {
query.IncludeItemTypes = new[] { "Playlist" }; query.ParentId = null;
query.IncludeItemTypes = new[] { typeof(Playlist).Name };
query.SetUser(user);
query.Recursive = true; query.Recursive = true;
return parent.GetItems(query); return _libraryManager.GetItemsResult(query);
} }
private QueryResult<BaseItem> GetMusicAlbums(Folder parent, User user, InternalItemsQuery query) private QueryResult<BaseItem> GetMusicAlbums(Folder parent, User user, InternalItemsQuery query)
@ -559,11 +561,14 @@ namespace MediaBrowser.Controller.Entities
return GetResult(_playlistManager.GetPlaylists(user.Id.ToString("N")), parent, query); return GetResult(_playlistManager.GetPlaylists(user.Id.ToString("N")), parent, query);
} }
private async Task<QueryResult<BaseItem>> GetBoxsetView(Folder parent, User user, InternalItemsQuery query) private QueryResult<BaseItem> GetBoxsetView(Folder parent, User user, InternalItemsQuery query)
{ {
var collections = _collectionManager.GetCollections(user); query.ParentId = null;
query.IncludeItemTypes = new[] { typeof(BoxSet).Name };
query.SetUser(user);
query.Recursive = true;
return GetResult(collections, parent, query); return _libraryManager.GetItemsResult(query);
} }
private async Task<QueryResult<BaseItem>> GetTvView(Folder parent, User user, InternalItemsQuery query) private async Task<QueryResult<BaseItem>> GetTvView(Folder parent, User user, InternalItemsQuery query)

Loading…
Cancel
Save