1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 01:42:35 +01:00

Fixed: Sorting queue by columns

This commit is contained in:
Bogdan 2024-09-22 07:30:46 +03:00
parent 9df45199d0
commit b8f1286abb

View File

@ -139,7 +139,26 @@ public object RemoveMany([FromBody] QueueBulkResource resource, [FromQuery] bool
public PagingResource<QueueResource> GetQueue([FromQuery] PagingRequestResource paging, bool includeUnknownMovieItems = false, bool includeMovie = false, [FromQuery] int[] movieIds = 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)
{
"timeleft",
"status",
"movies.sortTitle",
"year",
"languages",
"quality",
"protocol",
"indexer",
"downloadClient",
"title",
"size",
"estimatedCompletionTime",
"added",
"progress"
},
"timeleft",
SortDirection.Ascending);
return pagingSpec.ApplyToPage((spec) => GetQueue(spec, movieIds?.ToHashSet(), protocol, languages?.ToHashSet(), quality, includeUnknownMovieItems), (q) => MapToResource(q, includeMovie));
}