update season methods
This commit is contained in:
parent
43c94884e7
commit
d6dc6ffe7e
|
@ -702,7 +702,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
items = GetRecursiveChildren(user, query);
|
||||
}
|
||||
|
||||
return PostFilterAndSort(items, query);
|
||||
return PostFilterAndSort(items, query, true, true);
|
||||
}
|
||||
|
||||
if (!(this is UserRootFolder) && !(this is AggregateFolder))
|
||||
|
@ -903,7 +903,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
if (query.ItemIds.Length > 0)
|
||||
{
|
||||
var specificItems = query.ItemIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||
return Task.FromResult(PostFilterAndSort(specificItems, query));
|
||||
return Task.FromResult(PostFilterAndSort(specificItems, query, true, true));
|
||||
}
|
||||
|
||||
return GetItemsInternal(query);
|
||||
|
@ -959,12 +959,12 @@ namespace MediaBrowser.Controller.Entities
|
|||
: GetChildren(user, true).Where(filter);
|
||||
}
|
||||
|
||||
return PostFilterAndSort(items, query);
|
||||
return PostFilterAndSort(items, query, true, true);
|
||||
}
|
||||
|
||||
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query)
|
||||
protected QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items, InternalItemsQuery query, bool collapseBoxSetItems, bool enableSorting)
|
||||
{
|
||||
return UserViewBuilder.PostFilterAndSort(items, this, null, query, LibraryManager, ConfigurationManager);
|
||||
return UserViewBuilder.PostFilterAndSort(items, this, null, query, LibraryManager, ConfigurationManager, collapseBoxSetItems, enableSorting);
|
||||
}
|
||||
|
||||
public virtual IEnumerable<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
|
|
|
@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
var items = GetEpisodes(user).Where(filter);
|
||||
|
||||
Logger.Debug("Season.GetItemsInternal entering PostFilterAndSort. Request id: " + id);
|
||||
var result = PostFilterAndSort(items, query);
|
||||
var result = PostFilterAndSort(items, query, false, false);
|
||||
|
||||
Logger.Debug("Season.GetItemsInternal complete. Request id: " + id);
|
||||
return Task.FromResult(result);
|
||||
|
|
|
@ -237,7 +237,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
|
||||
|
||||
var items = GetSeasons(user).Where(filter);
|
||||
var result = PostFilterAndSort(items, query);
|
||||
var result = PostFilterAndSort(items, query, false, true);
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
var user = query.User;
|
||||
Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
|
||||
|
||||
return PostFilterAndSort(result.Where(filter), query);
|
||||
return PostFilterAndSort(result.Where(filter), query, true, true);
|
||||
}
|
||||
|
||||
public override int GetChildCount(User user)
|
||||
|
|
|
@ -424,7 +424,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
query.SortBy = new string[] { };
|
||||
|
||||
return PostFilterAndSort(items, parent, null, query);
|
||||
return PostFilterAndSort(items, parent, null, query, false, true);
|
||||
}
|
||||
|
||||
private QueryResult<BaseItem> GetFavoriteSongs(Folder parent, User user, InternalItemsQuery query)
|
||||
|
@ -780,7 +780,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
items = items.Where(i => Filter(i, query.User, query, _userDataManager, _libraryManager));
|
||||
|
||||
return PostFilterAndSort(items, queryParent, null, query, _libraryManager, _config);
|
||||
return PostFilterAndSort(items, queryParent, null, query, _libraryManager, _config, true, true);
|
||||
}
|
||||
|
||||
public static bool FilterItem(BaseItem item, InternalItemsQuery query)
|
||||
|
@ -791,9 +791,11 @@ namespace MediaBrowser.Controller.Entities
|
|||
private QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items,
|
||||
BaseItem queryParent,
|
||||
int? totalRecordLimit,
|
||||
InternalItemsQuery query)
|
||||
InternalItemsQuery query,
|
||||
bool collapseBoxSetItems,
|
||||
bool enableSorting)
|
||||
{
|
||||
return PostFilterAndSort(items, queryParent, totalRecordLimit, query, _libraryManager, _config);
|
||||
return PostFilterAndSort(items, queryParent, totalRecordLimit, query, _libraryManager, _config, collapseBoxSetItems, enableSorting);
|
||||
}
|
||||
|
||||
public static QueryResult<BaseItem> PostFilterAndSort(IEnumerable<BaseItem> items,
|
||||
|
@ -801,7 +803,9 @@ namespace MediaBrowser.Controller.Entities
|
|||
int? totalRecordLimit,
|
||||
InternalItemsQuery query,
|
||||
ILibraryManager libraryManager,
|
||||
IServerConfigurationManager configurationManager)
|
||||
IServerConfigurationManager configurationManager,
|
||||
bool collapseBoxSetItems,
|
||||
bool enableSorting)
|
||||
{
|
||||
var user = query.User;
|
||||
|
||||
|
@ -810,7 +814,10 @@ namespace MediaBrowser.Controller.Entities
|
|||
query.IsVirtualUnaired,
|
||||
query.IsUnaired);
|
||||
|
||||
items = CollapseBoxSetItemsIfNeeded(items, query, queryParent, user, configurationManager);
|
||||
if (collapseBoxSetItems)
|
||||
{
|
||||
items = CollapseBoxSetItemsIfNeeded(items, query, queryParent, user, configurationManager);
|
||||
}
|
||||
|
||||
// This must be the last filter
|
||||
if (!string.IsNullOrEmpty(query.AdjacentTo))
|
||||
|
@ -818,7 +825,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
items = FilterForAdjacency(items, query.AdjacentTo);
|
||||
}
|
||||
|
||||
return Sort(items, totalRecordLimit, query, libraryManager);
|
||||
return SortAndPage(items, totalRecordLimit, query, libraryManager, enableSorting);
|
||||
}
|
||||
|
||||
public static IEnumerable<BaseItem> CollapseBoxSetItemsIfNeeded(IEnumerable<BaseItem> items,
|
||||
|
@ -1191,10 +1198,10 @@ namespace MediaBrowser.Controller.Entities
|
|||
return items;
|
||||
}
|
||||
|
||||
public static QueryResult<BaseItem> Sort(IEnumerable<BaseItem> items,
|
||||
public static QueryResult<BaseItem> SortAndPage(IEnumerable<BaseItem> items,
|
||||
int? totalRecordLimit,
|
||||
InternalItemsQuery query,
|
||||
ILibraryManager libraryManager)
|
||||
ILibraryManager libraryManager, bool enableSorting)
|
||||
{
|
||||
var user = query.User;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user