Skip to content

Commit

Permalink
Session_model doesn't need validation
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed May 19, 2024
1 parent c36f4f8 commit 3bc1e1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions seplis_play_server/scanners/episodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions seplis_play_server/transcoders/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 4 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 3bc1e1d

Please sign in to comment.