mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-05 04:08:21 +02:00
if option in default_option isn't found, default value will be added to option.json
This commit is contained in:
parent
68c82393d6
commit
b9abcd2919
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@ default_option = {
|
||||||
"disable_download": False,
|
"disable_download": False,
|
||||||
"del_track_after_conv": False,
|
"del_track_after_conv": False,
|
||||||
"dont_check_for_update": False,
|
"dont_check_for_update": False,
|
||||||
|
"dont_check_track_sha1": False,
|
||||||
"process_track": 8
|
"process_track": 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,4 +22,8 @@ def change_option(self, option, value, restart=False):
|
||||||
def load_option(self):
|
def load_option(self):
|
||||||
if not(os.path.exists("./option.json")):
|
if not(os.path.exists("./option.json")):
|
||||||
with open("./option.json", "w", encoding="utf-8") as f: json.dump(default_option, f, ensure_ascii=False)
|
with open("./option.json", "w", encoding="utf-8") as f: json.dump(default_option, f, ensure_ascii=False)
|
||||||
with open("./option.json", encoding="utf-8") as f: self.option = json.load(f)
|
with open("./option.json", encoding="utf-8") as f: self.option = json.load(f)
|
||||||
|
|
||||||
|
for option_key, option_value in default_option.items():
|
||||||
|
if not(option_key in self.option):
|
||||||
|
self.option[option_key] = option_value
|
Loading…
Reference in a new issue