Allow blank sort direction

Some sort fields don't follow the `defaultDirection` if the sort direction is not specified (e.g. `year` returns `year:asc` instead of the default `year:desc`). Allow blank `sortDir` and let the server handle it.
This commit is contained in:
JonnyWong16 2021-06-18 14:03:43 -07:00
parent 4bd550c320
commit 176aa36729
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -921,10 +921,7 @@ class LibrarySection(PlexObject):
sortField = libtype + '.' + filterSort.key
if not sortDir:
sortDir = filterSort.defaultDirection
availableDirections = ['asc', 'desc', 'nullsLast']
availableDirections = ['', 'asc', 'desc', 'nullsLast']
if sortDir not in availableDirections:
raise NotFound('Unknown sort direction "%s". '
'Available sort directions: %s'