mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Added new option 'extract' to all processing sections, set to 1 for nzbToMedia or TorrentToMedia to extract files from archives or set to 0 for the processor to do the extraction after we finish processing what files we are able to.
Added code into migration function that removes obsolete options from migrating into the new config.
This commit is contained in:
parent
d511b54e66
commit
f73167ba74
1 changed files with 14 additions and 11 deletions
|
@ -147,18 +147,21 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
CFG_NEW['General']['force_clean'] = value
|
CFG_NEW['General']['force_clean'] = value
|
||||||
values.pop(option)
|
values.pop(option)
|
||||||
|
|
||||||
# remove any options that we no longer use or need from new config
|
# remove any options that we no longer need so they don't migrate into our new config
|
||||||
def find_key(d, key):
|
def find_key(node, kv):
|
||||||
for k, v in d.items():
|
if isinstance(node, list):
|
||||||
if isinstance(v, dict):
|
for i in node:
|
||||||
p = find_key(v, key)
|
for x in find_key(i, kv):
|
||||||
if p:
|
yield x
|
||||||
return [k] + p
|
elif isinstance(node, dict):
|
||||||
elif v == key:
|
if kv in node:
|
||||||
return [k]
|
yield node[kv]
|
||||||
|
for j in node.values():
|
||||||
|
for x in find_key(j, kv):
|
||||||
|
yield x
|
||||||
|
|
||||||
#if not find_key(CFG_NEW, option):
|
if not list(find_key(CFG_NEW, option)):
|
||||||
# values.pop(option)
|
values.pop(option)
|
||||||
|
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue