mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-12-10 15:15:12 -05:00
34 lines
639 B
Python
34 lines
639 B
Python
from __future__ import annotations
|
|
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from pydantic import Field
|
|
|
|
from .videos import Guess
|
|
from ..utils import Model
|
|
|
|
|
|
class Request(Model, extra="allow"):
|
|
pk: int | None = Field(exclude=True, default=None)
|
|
kind: Literal["episode", "movie"]
|
|
title: str
|
|
year: int | None
|
|
external_id: dict[str, str]
|
|
videos: list[Request.Video]
|
|
|
|
class Video(Model):
|
|
id: str
|
|
episodes: list[Guess.Episode]
|
|
|
|
class RequestRet(Model):
|
|
id: str
|
|
kind: Literal["episode", "movie"]
|
|
title: str
|
|
year: int | None
|
|
status: Literal[
|
|
"pending",
|
|
"running",
|
|
"failed",
|
|
]
|
|
started_at: datetime | None
|