use default enum for unordered

pull/12457/head
lostb1t 8 months ago
parent e59eac6a07
commit 0b7dc7ff64

@ -114,26 +114,19 @@ namespace MediaBrowser.Controller.Entities.Movies
public IEnumerable<BaseItem> Sort(IEnumerable<BaseItem> items, User user)
{
var sortBy = new[]
{
ItemSortBy.ProductionYear,
ItemSortBy.PremiereDate,
ItemSortBy.SortName
};
var sortBy = ItemSortBy.PremiereDate;
if (!string.IsNullOrEmpty(DisplayOrder))
{
if (DisplayOrder == "InsertDate")
{
return items;
}
sortBy = Enum.Parse<ItemSortBy>(DisplayOrder);
}
sortBy = new[]
{
Enum.Parse<ItemSortBy>(DisplayOrder)
};
if (sortBy == ItemSortBy.Default)
{
return items;
}
return LibraryManager.Sort(items, user, sortBy, SortOrder.Ascending);
return LibraryManager.Sort(items, user, new[] { sortBy }, SortOrder.Ascending);
}
public override List<BaseItem> GetChildren(User user, bool includeLinkedChildren, InternalItemsQuery query)

Loading…
Cancel
Save