From 832802208528d428fb31b3c8c72b8806da938013 Mon Sep 17 00:00:00 2001 From: Spoked Date: Tue, 21 Jan 2025 09:49:57 -0500 Subject: [PATCH] chore: tidy --- src/program/services/downloaders/models.py | 2 +- src/routers/secure/scrape.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/program/services/downloaders/models.py b/src/program/services/downloaders/models.py index 3bd407a2..dd1c78f0 100644 --- a/src/program/services/downloaders/models.py +++ b/src/program/services/downloaders/models.py @@ -41,7 +41,7 @@ class NoMatchingFilesException(Exception): class DebridFile(BaseModel): - """Represents a file in from a debrid service""" + """Represents a file from a debrid service""" file_id: Optional[int] = Field(default=None) filename: Optional[str] = Field(default=None) filesize: Optional[int] = Field(default=None) diff --git a/src/routers/secure/scrape.py b/src/routers/secure/scrape.py index 3df265c6..e67babcc 100644 --- a/src/routers/secure/scrape.py +++ b/src/routers/secure/scrape.py @@ -19,7 +19,7 @@ from program.services.scrapers import Scraping from program.services.scrapers.shared import rtn from program.types import Event -from program.services.downloaders.models import TorrentContainer, TorrentInfo +from program.services.downloaders.models import TorrentContainer, TorrentInfo, DebridFile class Stream(BaseModel): @@ -53,12 +53,7 @@ class UpdateAttributesResponse(BaseModel): class SessionResponse(BaseModel): message: str -class ContainerFile(BaseModel): - """Individual file entry in a container""" - filename: str - filesize: Optional[int] = None - -ContainerMap: TypeAlias = Dict[str, ContainerFile] +ContainerMap: TypeAlias = Dict[str, DebridFile] class Container(RootModel[ContainerMap]): """ @@ -78,7 +73,7 @@ class Container(RootModel[ContainerMap]): """ root: ContainerMap -SeasonEpisodeMap: TypeAlias = Dict[int, Dict[int, ContainerFile]] +SeasonEpisodeMap: TypeAlias = Dict[int, Dict[int, DebridFile]] class ShowFileData(RootModel[SeasonEpisodeMap]): """ @@ -329,7 +324,7 @@ def manual_select_files(request: Request, session_id, files: Container) -> Selec summary="Match container files to item", operation_id="manual_update_attributes" ) -async def manual_update_attributes(request: Request, session_id, data: Union[ContainerFile, ShowFileData]) -> UpdateAttributesResponse: +async def manual_update_attributes(request: Request, session_id, data: Union[DebridFile, ShowFileData]) -> UpdateAttributesResponse: session = session_manager.get_session(session_id) log_string = None if not session: