Skip to content

sok.core.adapters.media_adapters.movie

Movie media adapter for API response normalization.

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

MovieAdapter

class MovieAdapter

Bases: BaseAdapter

Adapter for normalizing movie API responses.

Source

adapt_details

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

Adapt movie detail response to normalized format.

Parameters

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

Returns

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

Adapt movie search results to normalized format.

Parameters

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

Returns

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