Skip to content

sok.core.adapters.media_adapters.tv

TV series media adapter for API response normalization.

Normalizes search results and details from TV APIs (TMDB, TVDB) into a consistent format.

TvAdapter

class TvAdapter

Bases: BaseAdapter

Adapter for normalizing TV series API responses.

Source

adapt_details

def adapt_details(
content_type: ContentType,
payload: Dict[str, Any],
) -> Dict[str, Any]:

Adapt TV series detail response to normalized format.

Parameters

NameTypeDescription
content_typeContentTypeType of content (TV_SERIES, EPISODE).
payloadDict[str, Any]Raw API detail response.

Returns

  • Dict[str, Any]Normalized TV series details dictionary.
Source
def adapt_search(
content_type: ContentType,
results: List[Dict[str, Any]],
) -> Dict[str, List[Dict[str, Any]]]:

Adapt TV series search results to normalized format.

Parameters

NameTypeDescription
content_typeContentTypeType of content (TV_SERIES, EPISODE).
resultsList[Dict[str, Any]]Raw API search results.

Returns

  • Dict[str, List[Dict[str, Any]]]Dictionary with 'results' key containing normalized TV series.
Source
Built with Kiln