Merge pull request #7492 from crobibero/sort-by

This commit is contained in:
Cody Robibero 2022-03-25 13:33:29 -06:00 committed by GitHub
commit d80c4ee381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3029,7 +3029,7 @@ namespace Emby.Server.Implementations.Data
if (string.Equals(name, ItemSortBy.PlayCount, StringComparison.OrdinalIgnoreCase)) if (string.Equals(name, ItemSortBy.PlayCount, StringComparison.OrdinalIgnoreCase))
{ {
return "PlayCount"; return ItemSortBy.PlayCount;
} }
if (string.Equals(name, ItemSortBy.IsFavoriteOrLiked, StringComparison.OrdinalIgnoreCase)) if (string.Equals(name, ItemSortBy.IsFavoriteOrLiked, StringComparison.OrdinalIgnoreCase))
@ -3039,7 +3039,7 @@ namespace Emby.Server.Implementations.Data
if (string.Equals(name, ItemSortBy.IsFolder, StringComparison.OrdinalIgnoreCase)) if (string.Equals(name, ItemSortBy.IsFolder, StringComparison.OrdinalIgnoreCase))
{ {
return "IsFolder"; return ItemSortBy.IsFolder;
} }
if (string.Equals(name, ItemSortBy.IsPlayed, StringComparison.OrdinalIgnoreCase)) if (string.Equals(name, ItemSortBy.IsPlayed, StringComparison.OrdinalIgnoreCase))
@ -3087,7 +3087,68 @@ namespace Emby.Server.Implementations.Data
return "SeriesName"; return "SeriesName";
} }
return name; if (string.Equals(name, ItemSortBy.AiredEpisodeOrder, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.AiredEpisodeOrder;
}
if (string.Equals(name, ItemSortBy.Album, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.Album;
}
if (string.Equals(name, ItemSortBy.DateCreated, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.DateCreated;
}
if (string.Equals(name, ItemSortBy.PremiereDate, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.PremiereDate;
}
if (string.Equals(name, ItemSortBy.StartDate, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.StartDate;
}
if (string.Equals(name, ItemSortBy.Name, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.Name;
}
if (string.Equals(name, ItemSortBy.CommunityRating, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.CommunityRating;
}
if (string.Equals(name, ItemSortBy.ProductionYear, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.ProductionYear;
}
if (string.Equals(name, ItemSortBy.CriticRating, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.CriticRating;
}
if (string.Equals(name, ItemSortBy.VideoBitRate, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.VideoBitRate;
}
if (string.Equals(name, ItemSortBy.ParentIndexNumber, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.ParentIndexNumber;
}
if (string.Equals(name, ItemSortBy.IndexNumber, StringComparison.OrdinalIgnoreCase))
{
return ItemSortBy.IndexNumber;
}
// Unknown SortBy, just sort by the SortName.
return ItemSortBy.SortName;
} }
public List<Guid> GetItemIdsList(InternalItemsQuery query) public List<Guid> GetItemIdsList(InternalItemsQuery query)