mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-03-06 11:49:29 +08:00
Fix provider configs updates
This commit is contained in:
parent
b9ba99e189
commit
a748903dc4
1 changed files with 13 additions and 1 deletions
|
@ -70,6 +70,16 @@ def remove_crap_from_fn(fn):
|
||||||
return REMOVE_CRAP_FROM_FILENAME.sub(repl, fn)
|
return REMOVE_CRAP_FROM_FILENAME.sub(repl, fn)
|
||||||
|
|
||||||
|
|
||||||
|
def _nested_update(item, to_update):
|
||||||
|
for k, v in to_update.items():
|
||||||
|
if isinstance(v, dict):
|
||||||
|
item[k] = _nested_update(item.get(k, {}), v)
|
||||||
|
else:
|
||||||
|
item[k] = v
|
||||||
|
|
||||||
|
return item
|
||||||
|
|
||||||
|
|
||||||
class _ProviderConfigs(dict):
|
class _ProviderConfigs(dict):
|
||||||
def __init__(self, pool, *args, **kwargs):
|
def __init__(self, pool, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
@ -108,7 +118,9 @@ class _ProviderConfigs(dict):
|
||||||
else:
|
else:
|
||||||
logger.debug("No provider config updates")
|
logger.debug("No provider config updates")
|
||||||
|
|
||||||
return super().update(items)
|
_nested_update(self, items)
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class _Banlist:
|
class _Banlist:
|
||||||
|
|
Loading…
Reference in a new issue