1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

parser.merge: rewrite and dont update items with std values

This commit is contained in:
Johan Andersson 2018-05-20 20:28:49 +02:00
parent 2e0bf58a3f
commit c41dba7077

View File

@ -241,10 +241,17 @@ def _special_settings(config):
def merge(old, new): def merge(old, new):
z = old.copy() if isinstance(new, list):
z.update(new) new = {list(i.keys())[0]: i[list(i.keys())[0]] for i in new}
config = setup_defaults()
for item in new:
if item in new:
if new[item] != config.get(item): # Check if new value is not a default one.
old[item] = new[item]
else:
old[item] = new[item]
options = Options() options = Options()
options.set_variable(z) options.set_variable(old)
return options return options