1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +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):
z = old.copy()
z.update(new)
if isinstance(new, list):
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.set_variable(z)
options.set_variable(old)
return options