optimize: move values1.json to configs/config.json

This commit is contained in:
源文雨
2023-08-27 00:46:03 +08:00
parent e67cf66fe0
commit edbf4b5139
3 changed files with 17 additions and 4 deletions

View File

@@ -92,14 +92,14 @@ if __name__ == "__main__":
def load(self):
input_devices, output_devices, _, _ = self.get_devices()
try:
with open("values1.json", "r") as j:
with open("configs/config.json", "r") as j:
data = json.load(j)
data["pm"] = data["f0method"] == "pm"
data["harvest"] = data["f0method"] == "harvest"
data["crepe"] = data["f0method"] == "crepe"
data["rmvpe"] = data["f0method"] == "rmvpe"
except:
with open("values1.json", "w") as j:
with open("configs/config.json", "w") as j:
data = {
"pth_path": " ",
"index_path": " ",
@@ -349,7 +349,7 @@ if __name__ == "__main__":
].index(True)
],
}
with open("values1.json", "w") as j:
with open("configs/config.json", "w") as j:
json.dump(settings, j)
if event == "stop_vc" and self.flag_vc == True:
self.flag_vc = False