chore: revert to use base settings class instead of partial settings

This commit is contained in:
2024-11-27 14:48:47 +01:00
parent 15457383c5
commit 6a2ca5e719

View File

@@ -3,7 +3,7 @@ import inspect
import sqlite3 as sql
import tempfile
from pathlib import Path
from src import database
from src import settings
from typing import Any, Dict, List, Optional, Tuple, Union
# from icecream import ic
from omegaconf import OmegaConf
@@ -33,7 +33,7 @@ from icecream import ic
ascii_lowercase = "abcdefghijklmnopqrstuvwxyz0123456789)"
caller_frame = inspect.stack()[1]
# get the line that called the function
database = settings.database
class Database:
"""
Initialize the database and create the tables if they do not exist.
@@ -302,7 +302,7 @@ class Database:
result = self.query_db(
"SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id, prof_id)
)
books = [load_pickle(i[0]) for i in result]
books: list[BookData] = [load_pickle(i[0]) for i in result]
book = [i for i in books if i.signature == signature][0]
return book