diff --git a/seplis_play_server/scanners/episodes.py b/seplis_play_server/scanners/episodes.py index 5b15181..4eb7617 100644 --- a/seplis_play_server/scanners/episodes.py +++ b/seplis_play_server/scanners/episodes.py @@ -105,9 +105,6 @@ async def save_item(self, item: schemas.Parsed_file_episode, path: str): if not await self.episode_number_lookup(item, path): return False try: - import logging - - logging.error('Saving episode') metadata = await self.get_metadata(path) if ep: diff --git a/seplis_play_server/transcoders/video.py b/seplis_play_server/transcoders/video.py index ad70768..474d25a 100644 --- a/seplis_play_server/transcoders/video.py +++ b/seplis_play_server/transcoders/video.py @@ -84,10 +84,11 @@ class Video_color(BaseModel): range_type: str -class Session_model(BaseModel): +@dataclass +class Session_model: process: asyncio.subprocess.Process - transcode_folder: Optional[str] | None = None call_later: asyncio.TimerHandle + transcode_folder: Optional[str] | None = None model_config = ConfigDict( arbitrary_types_allowed=True, diff --git a/tests/conftest.py b/tests/conftest.py index b63b154..9161bd6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,25 +1,22 @@ -import pytest_asyncio import tempfile + +import pytest_asyncio + from seplis_play_server import config from seplis_play_server.logger import set_logger @pytest_asyncio.fixture(scope="function") async def play_db_test(): - from seplis_play_server.database import database from seplis_play_server import scan + from seplis_play_server.database import database set_logger("play_test") config.test = True config.server_id = "123" with tempfile.TemporaryDirectory() as dir: - import logging - logging.error(f"Using temp dir: {dir}") config.database = f"sqlite:///{dir}/db.sqlite" scan.upgrade_scan_db() - logging.error(f"Using database: {config.database}") database.setup() - logging.error("Database setup") yield database - logging.error("Closing database") await database.close()