mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
updated AdvancedSettingsMixin
This commit is contained in:
parent
a999778f52
commit
b9bf8eeabc
1 changed files with 6 additions and 3 deletions
|
@ -41,11 +41,14 @@ class AdvancedSettingsMixin(object):
|
|||
key = '%s/prefs?' % self.key
|
||||
preferences = {pref.id: list(pref.enumValues.keys()) for pref in self.preferences()}
|
||||
for settingID, value in kwargs.items():
|
||||
enumValues = preferences.get(settingID)
|
||||
if value in enumValues:
|
||||
try:
|
||||
enums = preferences[settingID]
|
||||
except KeyError:
|
||||
raise NotFound('%s not found in %s' % (value, list(preferences.keys())))
|
||||
if value in enums:
|
||||
data[settingID] = value
|
||||
else:
|
||||
raise NotFound('%s not found in %s' % (value, enumValues))
|
||||
raise NotFound('%s not found in %s' % (value, enums))
|
||||
url = key + urlencode(data)
|
||||
self._server.query(url, method=self._server._session.put)
|
||||
|
||||
|
|
Loading…
Reference in a new issue