mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Don't shuffle some types by default
This commit is contained in:
@@ -1163,7 +1163,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
//the true root should return our users root folder children
|
||||
if (IsPhysicalRoot) return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
|
||||
if (IsPhysicalRoot)
|
||||
{
|
||||
return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
|
||||
}
|
||||
|
||||
var result = new Dictionary<Guid, BaseItem>();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
{
|
||||
Recursive = true,
|
||||
IsFolder = false,
|
||||
OrderBy = new[] { ItemSortBy.SortName }.Select(i => new ValueTuple<string, SortOrder>(i, SortOrder.Ascending)).ToArray(),
|
||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||
MediaTypes = new[] { mediaType },
|
||||
EnableTotalRecordCount = false,
|
||||
DtoOptions = options
|
||||
|
||||
Reference in New Issue
Block a user