Create presets file if not exists

This commit is contained in:
2024-02-29 17:31:13 +01:00
parent 1f2d363e91
commit 1198bb5320

View File

@@ -15,6 +15,9 @@ class GenerateUI:
"""
def get_presets(self):
if not os.path.exists("local/presets.json"):
with open("local/presets.json", "w") as f:
f.write(orjson.dumps({}))
with open("local/presets.json", "r") as f:
return orjson.loads(f.read())