From 830b9ed91f073ae0c06675bcee2da5558c939595 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Wed, 31 Jul 2019 16:06:49 -0400 Subject: [PATCH] fix for modeUpdate() was checking the wrong variable. corrected raise output. --- plexapi/library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plexapi/library.py b/plexapi/library.py index 9f195adf..ddfbb1df 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -1026,8 +1026,8 @@ class Collections(PlexObject): 'hideItems': '1', 'showItems': '2'} key = mode_dict.get(mode) - if mode is None: - raise BadRequest('Unknown collection mode : %s. Options %s' % (mode, list(mode_dict.key()))) + if key is None: + raise BadRequest('Unknown collection mode : %s. Options %s' % (mode, list(mode_dict))) part = '/library/metadata/%s/prefs?collectionMode=%s' % (self.ratingKey, key) return self._server.query(part, method=self._server._session.put) @@ -1047,7 +1047,7 @@ class Collections(PlexObject): 'alpha': '1'} key = sort_dict.get(sort) if key is None: - raise BadRequest('Unknown sort dir: %s. Options: %s' % (sort, list(sort_dict.keys()))) + raise BadRequest('Unknown sort dir: %s. Options: %s' % (sort, list(sort_dict))) part = '/library/metadata/%s/prefs?collectionSort=%s' % (self.ratingKey, key) return self._server.query(part, method=self._server._session.put)