diff --git a/src/backend/database.py b/src/backend/database.py index 403b1a1..b5873ce 100644 --- a/src/backend/database.py +++ b/src/backend/database.py @@ -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