Skip to content

Commit 830b9ed

Browse files
authored
fix for modeUpdate()
was checking the wrong variable. corrected raise output.
1 parent 319adf9 commit 830b9ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plexapi/library.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ def modeUpdate(self, mode=None):
10261026
'hideItems': '1',
10271027
'showItems': '2'}
10281028
key = mode_dict.get(mode)
1029-
if mode is None:
1030-
raise BadRequest('Unknown collection mode : %s. Options %s' % (mode, list(mode_dict.key())))
1029+
if key is None:
1030+
raise BadRequest('Unknown collection mode : %s. Options %s' % (mode, list(mode_dict)))
10311031
part = '/library/metadata/%s/prefs?collectionMode=%s' % (self.ratingKey, key)
10321032
return self._server.query(part, method=self._server._session.put)
10331033

@@ -1047,7 +1047,7 @@ def sortUpdate(self, sort=None):
10471047
'alpha': '1'}
10481048
key = sort_dict.get(sort)
10491049
if key is None:
1050-
raise BadRequest('Unknown sort dir: %s. Options: %s' % (sort, list(sort_dict.keys())))
1050+
raise BadRequest('Unknown sort dir: %s. Options: %s' % (sort, list(sort_dict)))
10511051
part = '/library/metadata/%s/prefs?collectionSort=%s' % (self.ratingKey, key)
10521052
return self._server.query(part, method=self._server._session.put)
10531053

0 commit comments

Comments
 (0)