mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-21 19:23:05 +00:00
Fix parsing settings enum (#1057)
* Assume key and value are equal when missing `key:value` pair
This commit is contained in:
parent
9dbb2e5169
commit
e5d3ebe273
1 changed files with 8 additions and 1 deletions
|
@ -139,7 +139,14 @@ class Setting(PlexObject):
|
|||
if not enumstr:
|
||||
return None
|
||||
if ':' in enumstr:
|
||||
return {self._cast(k): v for k, v in [kv.split(':') for kv in enumstr.split('|')]}
|
||||
d = {}
|
||||
for kv in enumstr.split('|'):
|
||||
try:
|
||||
k, v = kv.split(':')
|
||||
d[self._cast(k)] = v
|
||||
except ValueError:
|
||||
d[self._cast(kv)] = kv
|
||||
return d
|
||||
return enumstr.split('|')
|
||||
|
||||
def set(self, value):
|
||||
|
|
Loading…
Reference in a new issue