mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
Merge branch 'master' into mediaencoding
This commit is contained in:
@@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public bool EnableGroupByMetadataKey { get; set; }
|
||||
public bool? HasChapterImages { get; set; }
|
||||
|
||||
public ValueTuple<string, SortOrder>[] OrderBy { get; set; }
|
||||
public IReadOnlyList<(string, SortOrder)> OrderBy { get; set; }
|
||||
|
||||
public DateTime? MinDateCreated { get; set; }
|
||||
public DateTime? MinDateLastSaved { get; set; }
|
||||
|
||||
@@ -226,14 +226,16 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
query.AncestorWithPresentationUniqueKey = null;
|
||||
query.SeriesPresentationUniqueKey = seriesKey;
|
||||
if (query.OrderBy.Length == 0)
|
||||
if (query.OrderBy.Count == 0)
|
||||
{
|
||||
query.OrderBy = new[] { ItemSortBy.SortName }.Select(i => new ValueTuple<string, SortOrder>(i, SortOrder.Ascending)).ToArray();
|
||||
}
|
||||
|
||||
if (query.IncludeItemTypes.Length == 0)
|
||||
{
|
||||
query.IncludeItemTypes = new[] { typeof(Episode).Name, typeof(Season).Name };
|
||||
}
|
||||
|
||||
query.IsVirtualItem = false;
|
||||
return LibraryManager.GetItemsResult(query);
|
||||
}
|
||||
|
||||
@@ -450,14 +450,16 @@ namespace MediaBrowser.Controller.Entities
|
||||
return SortAndPage(items, totalRecordLimit, query, libraryManager, true);
|
||||
}
|
||||
|
||||
public static QueryResult<BaseItem> SortAndPage(IEnumerable<BaseItem> items,
|
||||
public static QueryResult<BaseItem> SortAndPage(
|
||||
IEnumerable<BaseItem> items,
|
||||
int? totalRecordLimit,
|
||||
InternalItemsQuery query,
|
||||
ILibraryManager libraryManager, bool enableSorting)
|
||||
ILibraryManager libraryManager,
|
||||
bool enableSorting)
|
||||
{
|
||||
if (enableSorting)
|
||||
{
|
||||
if (query.OrderBy.Length > 0)
|
||||
if (query.OrderBy.Count > 0)
|
||||
{
|
||||
items = libraryManager.Sort(items, query.User, query.OrderBy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user