mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-17 05:18:26 +00:00
update library.LibrarySection._cleanSearchSort method to pull sort keys from LibrarySection._sorts() instead of using hardcoded ALLOWED_SORT.
This commit is contained in:
parent
a665d6f3ee
commit
14c122c87b
1 changed files with 2 additions and 1 deletions
|
@ -699,7 +699,8 @@ class LibrarySection(PlexObject):
|
||||||
def _cleanSearchSort(self, sort):
|
def _cleanSearchSort(self, sort):
|
||||||
sort = '%s:asc' % sort if ':' not in sort else sort
|
sort = '%s:asc' % sort if ':' not in sort else sort
|
||||||
scol, sdir = sort.lower().split(':')
|
scol, sdir = sort.lower().split(':')
|
||||||
lookup = {s.lower(): s for s in self.ALLOWED_SORT}
|
allowedSort = [sort.key for sort in self._sorts()]
|
||||||
|
lookup = {s.lower(): s for s in allowedSort}
|
||||||
if scol not in lookup:
|
if scol not in lookup:
|
||||||
raise BadRequest('Unknown sort column: %s' % scol)
|
raise BadRequest('Unknown sort column: %s' % scol)
|
||||||
if sdir not in ('asc', 'desc'):
|
if sdir not in ('asc', 'desc'):
|
||||||
|
|
Loading…
Add table
Reference in a new issue