fix: RESET_CONFIG_ON_START not working

This commit is contained in:
Timothy J. Baek
2024-09-25 01:06:11 +02:00
parent 1767b64135
commit 92b1acd6fb
3 changed files with 15 additions and 12 deletions

View File

@@ -87,6 +87,12 @@ def save_to_db(data):
db.commit()
def reset_config():
with get_db() as db:
db.query(Config).delete()
db.commit()
# When initializing, check if config.json exists and migrate it to the database
if os.path.exists(f"{DATA_DIR}/config.json"):
data = load_json_config()