mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-29 23:12:39 +01:00
Fixed: Sorting queue by columns
Sort allowed keys Co-authored-by: Mark McDowall <markus.mcd5@gmail.com>
This commit is contained in:
parent
be4a9e9491
commit
30a52d11aa
@ -33,10 +33,10 @@ namespace Sonarr.Api.V3.Blocklist
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<BlocklistResource, NzbDrone.Core.Blocklisting.Blocklist>(
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"series.sortTitle",
|
||||
"sourceTitle",
|
||||
"date",
|
||||
"indexer"
|
||||
"indexer",
|
||||
"series.sortTitle",
|
||||
"sourceTitle"
|
||||
},
|
||||
"date",
|
||||
SortDirection.Descending);
|
||||
|
@ -68,8 +68,8 @@ namespace Sonarr.Api.V3.History
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, EpisodeHistory>(
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"series.sortTitle",
|
||||
"date"
|
||||
"date",
|
||||
"series.sortTitle"
|
||||
},
|
||||
"date",
|
||||
SortDirection.Descending);
|
||||
|
@ -51,8 +51,8 @@ namespace Sonarr.Api.V3.ImportLists
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"id",
|
||||
"tvdbId",
|
||||
"title"
|
||||
"title",
|
||||
"tvdbId"
|
||||
},
|
||||
"id",
|
||||
SortDirection.Descending);
|
||||
|
@ -139,7 +139,31 @@ namespace Sonarr.Api.V3.Queue
|
||||
public PagingResource<QueueResource> GetQueue([FromQuery] PagingRequestResource paging, bool includeUnknownSeriesItems = false, bool includeSeries = false, bool includeEpisode = false, [FromQuery] int[] seriesIds = null, DownloadProtocol? protocol = null, [FromQuery] int[] languages = null, int? quality = null)
|
||||
{
|
||||
var pagingResource = new PagingResource<QueueResource>(paging);
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<QueueResource, NzbDrone.Core.Queue.Queue>(null, "timeleft", SortDirection.Ascending);
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<QueueResource, NzbDrone.Core.Queue.Queue>(
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"added",
|
||||
"downloadClient",
|
||||
"episode",
|
||||
"episode.airDateUtc",
|
||||
"episode.title",
|
||||
"episodes.airDateUtc",
|
||||
"episodes.title",
|
||||
"estimatedCompletionTime",
|
||||
"indexer",
|
||||
"language",
|
||||
"languages",
|
||||
"progress",
|
||||
"protocol",
|
||||
"quality",
|
||||
"series.sortTitle",
|
||||
"size",
|
||||
"status",
|
||||
"timeleft",
|
||||
"title"
|
||||
},
|
||||
"timeleft",
|
||||
SortDirection.Ascending);
|
||||
|
||||
return pagingSpec.ApplyToPage((spec) => GetQueue(spec, seriesIds?.ToHashSet(), protocol, languages?.ToHashSet(), quality, includeUnknownSeriesItems), (q) => MapToResource(q, includeSeries, includeEpisode));
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ namespace Sonarr.Api.V3.Wanted
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<EpisodeResource, Episode>(
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"series.sortTitle",
|
||||
"episodes.airDateUtc",
|
||||
"episodes.lastSearchTime"
|
||||
"episodes.lastSearchTime",
|
||||
"series.sortTitle"
|
||||
},
|
||||
"episodes.airDateUtc",
|
||||
SortDirection.Ascending);
|
||||
|
@ -32,9 +32,9 @@ namespace Sonarr.Api.V3.Wanted
|
||||
var pagingSpec = pagingResource.MapToPagingSpec<EpisodeResource, Episode>(
|
||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"series.sortTitle",
|
||||
"episodes.airDateUtc",
|
||||
"episodes.lastSearchTime"
|
||||
"episodes.lastSearchTime",
|
||||
"series.sortTitle"
|
||||
},
|
||||
"episodes.airDateUtc",
|
||||
SortDirection.Ascending);
|
||||
|
Loading…
Reference in New Issue
Block a user