mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-23 17:27:25 +00:00
support json in setting_set
This commit is contained in:
parent
d9b482d90a
commit
454700af05
1 changed files with 2 additions and 0 deletions
|
@ -1028,6 +1028,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
(dict) Updated dictionary of daemon settings
|
(dict) Updated dictionary of daemon settings
|
||||||
"""
|
"""
|
||||||
with self.conf.update_config() as c:
|
with self.conf.update_config() as c:
|
||||||
|
if value and isinstance(value, str) and value[0] in ('[', '{'):
|
||||||
|
value = json.loads(value)
|
||||||
attr: Setting = getattr(type(c), key)
|
attr: Setting = getattr(type(c), key)
|
||||||
cleaned = attr.deserialize(value)
|
cleaned = attr.deserialize(value)
|
||||||
setattr(c, key, cleaned)
|
setattr(c, key, cleaned)
|
||||||
|
|
Loading…
Add table
Reference in a new issue