"""
Data models for ThePornDB MCP Service.
These TypedDict definitions are reused from the movie-nfo project to maintain consistency
and avoid duplication. They match the ThePornDB API response structure.
"""
from typing import TypedDict, List, Dict, Optional
# ===================================================================
# 1. Core Media Data Structures (Generic)
# ===================================================================
class ImageUrls(TypedDict):
"""Image URL collection with multiple sizes."""
full: Optional[str]
large: Optional[str]
medium: Optional[str]
small: Optional[str]
class PosterSize(TypedDict):
"""Poster/background image dimensions."""
large: Optional[str]
medium: Optional[str]
small: Optional[str]
class PerformerExtras(TypedDict):
"""Performer additional information (brief)."""
astrology: Optional[str]
birthday: Optional[str]
birthplace: Optional[str]
cupsize: Optional[str]
ethnicity: Optional[str]
eye_colour: Optional[str]
fakeboobs: Optional[bool]
gender: Optional[str]
haircolor: Optional[str]
height: Optional[str]
measurements: Optional[str]
nationality: Optional[str]
piercings: Optional[str]
tattoos: Optional[str]
weight: Optional[str]
PerformerLink = Dict[str, Optional[str]]
class PerformerPoster(TypedDict):
"""Single performer poster information."""
id: int
url: str
size: int
order: int
class ParentPerformerExtras(TypedDict):
"""Parent performer additional detailed information."""
gender: Optional[str]
birthday: Optional[str]
birthday_timestamp: Optional[int]
deathday: Optional[str]
deathday_timestamp: Optional[int]
birthplace: Optional[str]
birthplace_code: Optional[str]
astrology: Optional[str]
ethnicity: Optional[str]
nationality: Optional[str]
hair_colour: Optional[str]
eye_colour: Optional[str]
weight: Optional[str]
height: Optional[str]
measurements: Optional[str]
cupsize: Optional[str]
tattoos: Optional[str]
piercings: Optional[str]
waist: Optional[str]
hips: Optional[str]
fake_boobs: Optional[bool]
same_sex_only: Optional[bool]
career_start_year: Optional[int]
career_end_year: Optional[int]
links: PerformerLink
class ParentPerformer(TypedDict):
"""Parent performer (main profile) information."""
id: str
_id: int
slug: str
name: str
bio: Optional[str]
rating: float
is_parent: bool
extras: ParentPerformerExtras
image: str
thumbnail: str
face: str
posters: List[PerformerPoster]
class Performer(TypedDict):
"""Performer information."""
id: str
_id: int
slug: str
site_id: int
name: str
bio: Optional[str]
is_parent: bool
extra: PerformerExtras
image: str
thumbnail: str
face: str
parent: Optional[ParentPerformer]
class SiteNetwork(TypedDict):
"""Site network information."""
uuid: str
id: int
name: str
short_name: str
class SiteDetails(TypedDict):
"""Site information."""
uuid: str
id: int
parent_id: int
network_id: int
name: str
url: str
network: SiteNetwork
parent: SiteNetwork
class Tag(TypedDict):
"""Tag information."""
id: int
uuid: str
name: str
class MediaData(TypedDict, total=False):
"""Generic media data structure (scenes, movies, JAV)."""
id: str
_id: int
title: str
type: str
slug: str
description: str
date: str
url: str
image: str
posters: PosterSize
background: ImageUrls
background_back: ImageUrls
created: str
last_updated: str
performers: List[Performer]
site: SiteDetails
tags: List[Tag]
rating: Optional[float]
duration: Optional[int]
trailer: Optional[str]
directors: List[Dict]
# ===================================================================
# 2. API Response Outer Structure (Generic)
# ===================================================================
class PaginationLink(TypedDict):
"""Pagination link item."""
url: Optional[str]
label: str
page: Optional[int]
active: bool
class PaginationMeta(TypedDict):
"""Pagination response metadata."""
current_page: int
from_index: int
last_page: int
links: List[PaginationLink]
path: str
per_page: int
to_index: int
total: int
class SearchResponse(TypedDict):
"""Generic search API response structure."""
data: List[MediaData]
meta: PaginationMeta
class DetailResponse(TypedDict):
"""Generic detail API response structure."""
data: MediaData