From e5ede625b3fc7e0b71736b42eb4f52a2f5d63378 Mon Sep 17 00:00:00 2001 From: Parker Date: Mon, 20 Jan 2025 20:44:23 -0600 Subject: Put database within data dir --- code/utils/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'code/utils/config.py') diff --git a/code/utils/config.py b/code/utils/config.py index f3fc971..9e1b687 100644 --- a/code/utils/config.py +++ b/code/utils/config.py @@ -153,7 +153,9 @@ def database_setup() -> None: """ Create the database if it does not exist """ - db = sqlite3.connect("cordarr.db") + 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," -- cgit v1.2.3-70-g09d2