diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-24 11:48:06 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-24 11:48:06 -0400 |
| commit | 58a38d0d1ddb89439b763e7bc50e8b84105f68fe (patch) | |
| tree | 3500fb6b08bab5549219b6bf32f10e9f1e9a01e5 /MediaBrowser.Controller | |
| parent | e4edbfdfd66797ce3aa52bdcfcf4ce8a9f1c5745 (diff) | |
update translations
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 2659a7c133..5da810a91b 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 }; |
