Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tidy #977

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/program/services/downloaders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 4 additions & 9 deletions src/routers/secure/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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]):
"""
Expand All @@ -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]):
"""
Expand Down Expand Up @@ -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:
Expand Down
Loading