diff options
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Playlists/Playlist.cs | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index 2659a7c13..5da810a91 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -1,5 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; +using MediaBrowser.Controller.Entities.Movies; +using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; using System; @@ -82,6 +84,30 @@ namespace MediaBrowser.Controller.Playlists return LibraryManager.Sort(songs, user, new[] { ItemSortBy.AlbumArtist, ItemSortBy.Album, ItemSortBy.SortName }, SortOrder.Ascending); } + // Grab these explicitly to avoid the sorting that will happen below + var collection = i as BoxSet; + if (collection != null) + { + var items = user == null + ? collection.Children + : collection.GetChildren(user, true); + + return items + .Where(m => !m.IsFolder); + } + + // Grab these explicitly to avoid the sorting that will happen below + var season = i as Season; + if (season != null) + { + var items = user == null + ? season.Children + : season.GetChildren(user, true); + + return items + .Where(m => !m.IsFolder); + } + var folder = i as Folder; if (folder != null) @@ -93,12 +119,7 @@ namespace MediaBrowser.Controller.Playlists items = items .Where(m => !m.IsFolder); - if (!folder.IsPreSorted) - { - items = LibraryManager.Sort(items, user, new[] { ItemSortBy.SortName }, SortOrder.Ascending); - } - - return items; + return LibraryManager.Sort(items, user, new[] { ItemSortBy.SortName }, SortOrder.Ascending); } return new[] { i }; |
