Merge pull request #5929 from crobibero/sort
This commit is contained in:
commit
50f617357b
|
@ -5463,7 +5463,9 @@ AND Type = @InternalPersonType)");
|
||||||
|
|
||||||
commandText += whereText + " group by PresentationUniqueKey";
|
commandText += whereText + " group by PresentationUniqueKey";
|
||||||
|
|
||||||
if (query.SimilarTo != null || !string.IsNullOrEmpty(query.SearchTerm))
|
if (query.OrderBy.Count != 0
|
||||||
|
|| query.SimilarTo != null
|
||||||
|
|| !string.IsNullOrEmpty(query.SearchTerm))
|
||||||
{
|
{
|
||||||
commandText += GetOrderByText(query);
|
commandText += GetOrderByText(query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
||||||
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
||||||
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
||||||
|
/// <param name="sortBy">Optional. Specify one or more sort orders, comma delimited.</param>
|
||||||
|
/// <param name="sortOrder">Sort Order - Ascending,Descending.</param>
|
||||||
/// <param name="enableImages">Optional, include image information in output.</param>
|
/// <param name="enableImages">Optional, include image information in output.</param>
|
||||||
/// <param name="enableTotalRecordCount">Total record count.</param>
|
/// <param name="enableTotalRecordCount">Total record count.</param>
|
||||||
/// <response code="200">Artists returned.</response>
|
/// <response code="200">Artists returned.</response>
|
||||||
|
@ -112,6 +114,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] string? nameStartsWithOrGreater,
|
[FromQuery] string? nameStartsWithOrGreater,
|
||||||
[FromQuery] string? nameStartsWith,
|
[FromQuery] string? nameStartsWith,
|
||||||
[FromQuery] string? nameLessThan,
|
[FromQuery] string? nameLessThan,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] sortBy,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] SortOrder[] sortOrder,
|
||||||
[FromQuery] bool? enableImages = true,
|
[FromQuery] bool? enableImages = true,
|
||||||
[FromQuery] bool enableTotalRecordCount = true)
|
[FromQuery] bool enableTotalRecordCount = true)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +154,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
MinCommunityRating = minCommunityRating,
|
MinCommunityRating = minCommunityRating,
|
||||||
DtoOptions = dtoOptions,
|
DtoOptions = dtoOptions,
|
||||||
SearchTerm = searchTerm,
|
SearchTerm = searchTerm,
|
||||||
EnableTotalRecordCount = enableTotalRecordCount
|
EnableTotalRecordCount = enableTotalRecordCount,
|
||||||
|
OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parentId.HasValue)
|
if (parentId.HasValue)
|
||||||
|
|
|
@ -63,6 +63,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
||||||
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
||||||
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
||||||
|
/// <param name="sortBy">Optional. Specify one or more sort orders, comma delimited.</param>
|
||||||
|
/// <param name="sortOrder">Sort Order - Ascending,Descending.</param>
|
||||||
/// <param name="enableImages">Optional, include image information in output.</param>
|
/// <param name="enableImages">Optional, include image information in output.</param>
|
||||||
/// <param name="enableTotalRecordCount">Optional. Include total record count.</param>
|
/// <param name="enableTotalRecordCount">Optional. Include total record count.</param>
|
||||||
/// <response code="200">Genres returned.</response>
|
/// <response code="200">Genres returned.</response>
|
||||||
|
@ -84,6 +86,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] string? nameStartsWithOrGreater,
|
[FromQuery] string? nameStartsWithOrGreater,
|
||||||
[FromQuery] string? nameStartsWith,
|
[FromQuery] string? nameStartsWith,
|
||||||
[FromQuery] string? nameLessThan,
|
[FromQuery] string? nameLessThan,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] sortBy,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] SortOrder[] sortOrder,
|
||||||
[FromQuery] bool? enableImages = true,
|
[FromQuery] bool? enableImages = true,
|
||||||
[FromQuery] bool enableTotalRecordCount = true)
|
[FromQuery] bool enableTotalRecordCount = true)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +111,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
NameStartsWithOrGreater = nameStartsWithOrGreater,
|
NameStartsWithOrGreater = nameStartsWithOrGreater,
|
||||||
DtoOptions = dtoOptions,
|
DtoOptions = dtoOptions,
|
||||||
SearchTerm = searchTerm,
|
SearchTerm = searchTerm,
|
||||||
EnableTotalRecordCount = enableTotalRecordCount
|
EnableTotalRecordCount = enableTotalRecordCount,
|
||||||
|
OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parentId.HasValue)
|
if (parentId.HasValue)
|
||||||
|
|
|
@ -63,6 +63,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
/// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a given input string.</param>
|
||||||
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
/// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</param>
|
||||||
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
/// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</param>
|
||||||
|
/// <param name="sortBy">Optional. Specify one or more sort orders, comma delimited.</param>
|
||||||
|
/// <param name="sortOrder">Sort Order - Ascending,Descending.</param>
|
||||||
/// <param name="enableImages">Optional, include image information in output.</param>
|
/// <param name="enableImages">Optional, include image information in output.</param>
|
||||||
/// <param name="enableTotalRecordCount">Optional. Include total record count.</param>
|
/// <param name="enableTotalRecordCount">Optional. Include total record count.</param>
|
||||||
/// <response code="200">Music genres returned.</response>
|
/// <response code="200">Music genres returned.</response>
|
||||||
|
@ -84,6 +86,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] string? nameStartsWithOrGreater,
|
[FromQuery] string? nameStartsWithOrGreater,
|
||||||
[FromQuery] string? nameStartsWith,
|
[FromQuery] string? nameStartsWith,
|
||||||
[FromQuery] string? nameLessThan,
|
[FromQuery] string? nameLessThan,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] sortBy,
|
||||||
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] SortOrder[] sortOrder,
|
||||||
[FromQuery] bool? enableImages = true,
|
[FromQuery] bool? enableImages = true,
|
||||||
[FromQuery] bool enableTotalRecordCount = true)
|
[FromQuery] bool enableTotalRecordCount = true)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +111,8 @@ namespace Jellyfin.Api.Controllers
|
||||||
NameStartsWithOrGreater = nameStartsWithOrGreater,
|
NameStartsWithOrGreater = nameStartsWithOrGreater,
|
||||||
DtoOptions = dtoOptions,
|
DtoOptions = dtoOptions,
|
||||||
SearchTerm = searchTerm,
|
SearchTerm = searchTerm,
|
||||||
EnableTotalRecordCount = enableTotalRecordCount
|
EnableTotalRecordCount = enableTotalRecordCount,
|
||||||
|
OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parentId.HasValue)
|
if (parentId.HasValue)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user