Fixed: Default sort key for wanted/missing API endpoint

Closes #4950
This commit is contained in:
Mark McDowall 2022-03-28 17:11:31 -07:00
parent a3fd3c5e67
commit e7ca98489e
2 changed files with 2 additions and 8 deletions

View File

@ -23,14 +23,7 @@ namespace Sonarr.Api.V3.Wanted
private PagingResource<EpisodeResource> GetMissingEpisodes(PagingResource<EpisodeResource> pagingResource)
{
var pagingSpec = new PagingSpec<Episode>
{
Page = pagingResource.Page,
PageSize = pagingResource.PageSize,
SortKey = pagingResource.SortKey,
SortDirection = pagingResource.SortDirection
};
var pagingSpec = pagingResource.MapToPagingSpec<EpisodeResource, Episode>("airDateUtc", SortDirection.Descending);
var includeSeries = Request.GetBooleanQueryParameter("includeSeries");
var includeImages = Request.GetBooleanQueryParameter("includeImages");
var monitoredFilter = pagingResource.Filters.FirstOrDefault(f => f.Key == "monitored");

View File

@ -29,6 +29,7 @@ namespace Sonarr.Http
if (pagingResource.SortKey == null)
{
pagingSpec.SortKey = defaultSortKey;
if(pagingResource.SortDirection == SortDirection.Default)
{
pagingSpec.SortDirection = defaultSortDirection;