From 31d079f1baea895b5cb0f1a737140ab94dc9a4fe Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sat, 9 Mar 2013 23:22:36 -0500 Subject: unified the two sorting api's --- MediaBrowser.Controller/Library/DtoBuilder.cs | 5 ----- MediaBrowser.Controller/Library/ILibraryManager.cs | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Controller/Library') diff --git a/MediaBrowser.Controller/Library/DtoBuilder.cs b/MediaBrowser.Controller/Library/DtoBuilder.cs index 92a15b117..bdaa51b6c 100644 --- a/MediaBrowser.Controller/Library/DtoBuilder.cs +++ b/MediaBrowser.Controller/Library/DtoBuilder.cs @@ -373,11 +373,6 @@ namespace MediaBrowser.Controller.Library { dto.IndexOptions = folder.IndexByOptionStrings.ToArray(); } - - if (fields.Contains(ItemFields.SortOptions)) - { - dto.SortOptions = folder.SortByOptionStrings.ToArray(); - } } // Add audio info diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 3f1930209..40131b6d2 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Resolvers; +using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; @@ -158,7 +159,19 @@ namespace MediaBrowser.Controller.Library /// The plugin folders. /// The resolvers. /// The intro providers. + /// The item comparers. void AddParts(IEnumerable rules, IEnumerable pluginFolders, - IEnumerable resolvers, IEnumerable introProviders); + IEnumerable resolvers, IEnumerable introProviders, IEnumerable itemComparers); + + /// + /// Sorts the specified items. + /// + /// The items. + /// The user. + /// The sort by. + /// The sort order. + /// IEnumerable{BaseItem}. + IEnumerable Sort(IEnumerable items, User user, IEnumerable sortBy, + SortOrder sortOrder); } } \ No newline at end of file -- cgit v1.2.3