diff options
author | Parker <contact@pkrm.dev> | 2025-01-21 20:38:33 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-01-21 20:38:33 -0600 |
commit | b0ea7ab93564f1b2f004f7ea74783508f12f4ff6 (patch) | |
tree | 2bf229bff30649598bd651d15fcf1ec9feaf4b13 /code/utils/config.py | |
parent | 023ee141ebf437919a4c0f43ddee18aaefa4cbbc (diff) |
Fixes + Use SQLAlchemy
Diffstat (limited to 'code/utils/config.py')
-rw-r--r-- | code/utils/config.py | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/code/utils/config.py b/code/utils/config.py index 1e7fdc6..ba1fac5 100644 --- a/code/utils/config.py +++ b/code/utils/config.py @@ -4,7 +4,6 @@ import sys import os import logging import requests -import sqlite3 from colorlog import ColoredFormatter @@ -108,10 +107,9 @@ schema = { def load_config() -> None: """ - Load DB, then load and validate the config file + Load the config file and validate it If the file does not exist, generate it """ - database_setup() if os.path.exists("/.dockerenv"): file_path = "config/config.yaml" else: @@ -157,26 +155,6 @@ jellyfin: ) -def database_setup() -> None: - """ - Create the database if it does not exist - """ - if not os.path.exists("data"): - os.makedirs("data") - db = sqlite3.connect("data/cordarr.db") - cursor = db.cursor() - cursor.execute( - "CREATE TABLE IF NOT EXISTS requests (title TEXT, release_year TEXT," - " local_id INTEGER, tmdbid INTEGER, tvdbid INTEGER, user_id INTEGER)" - ) - cursor.execute( - "CREATE TABLE IF NOT EXISTS jellyfin_accounts (user_id INTEGER," - " jellyfin_user_id INTEGER, deletion_time DATETIME)" - ) - db.commit() - db.close() - - def validate_config(contents) -> None: """ Validate the contents of the config file and assign variables |