sok.core.adapters.media_adapters.game
Game media adapter for API response normalization.
Normalizes search results and details from game APIs (IGDB, RAWG) into a consistent format.
GameAdapter
class GameAdapterBases: BaseAdapter
Adapter for normalizing game API responses.
Sourceadapt_details
def adapt_details( content_type: ContentType, payload: Dict[str, Any],) -> Dict[str, Any]:Adapt game detail response to normalized format.
Parameters
| Name | Type | Description |
|---|---|---|
content_type | ContentType | Type of content (GAME). |
payload | Dict[str, Any] | Raw API detail response. |
Returns
Dict[str, Any]Normalized game details dictionary.
adapt_search
def adapt_search( content_type: ContentType, results: List[Dict[str, Any]],) -> Dict[str, List[Dict[str, Any]]]:Adapt game search results to normalized format.
Parameters
| Name | Type | Description |
|---|---|---|
content_type | ContentType | Type of content (GAME). |
results | List[Dict[str, Any]] | Raw API search results. |
Returns
Dict[str, List[Dict[str, Any]]]Dictionary with 'results' key containing normalized games.