update library.LibrarySection._cleanSearchSort method to pull sort keys from LibrarySection._sorts() instead of using hardcoded ALLOWED_SORT.

This commit is contained in:
blacktwin 2020-06-30 09:33:53 -04:00
parent a665d6f3ee
commit 14c122c87b

View file

@ -699,7 +699,8 @@ class LibrarySection(PlexObject):
def _cleanSearchSort(self, sort):
sort = '%s:asc' % sort if ':' not in sort else sort
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:
raise BadRequest('Unknown sort column: %s' % scol)
if sdir not in ('asc', 'desc'):