import pydantic
from typing import List


class SearchParams(pydantic.BaseModel):
    query: str
    search_type: str | None = None
    genre: str | None = None
    sort: str | None = None
    year: str | None = None
    month: str | None = None
    page: int = 1


class SearchItem(pydantic.BaseModel):
    video_id: int
    title: str
    author_name: str
    img_link: str
    viewings_str: str
    time_duration_str: str


class RelateVideo(pydantic.BaseModel):
    title: str
    img_link: str


class Video(pydantic.BaseModel):
    id: int
    title: str
    desc: str
    author: str
    tags: List[str] = []
    comic_id: int | None = None
    relate_videos: List[RelateVideo] = []


class DownloadItem(pydantic.BaseModel):
    quality: str
    format: str
    link: str


class Comic(pydantic.BaseModel):
    id: int
    gallery_id: int
    title: str
    desc: str
    author: str
    total_pages: int
    tags: List[str] = []
