from __future__ import annotations

from datetime import date
from enum import Enum
from typing import Any, Literal

from pydantic import Field

from ..utils import Language, Model
from .metadataid import EpisodeId, MetadataId


class EntryContent(str, Enum):
	STORY = "story"
	RECAP = "recap"
	FILLER = "filler"
	OVA = "ova"


class Entry(Model):
	kind: Literal["episode", "movie", "special"]
	order: float
	runtime: int | None
	air_date: date | None
	thumbnail: str | None
	content: EntryContent

	# Movie-specific fields
	slug: str | None

	# Episode-specific fields
	season_number: int | None
	episode_number: int | None

	# Special-specific fields
	number: int | None

	external_id: dict[str, list[MetadataId | EpisodeId]]
	translations: dict[Language, EntryTranslation] = {}
	videos: list[str] = []
	extra: dict[str, Any] = Field(exclude=True)


class EntryTranslation(Model):
	name: str | None
	description: str | None
	tagline: str | None
	poster: str | None
