Files
romm/backend/endpoints/responses/stats.py
cc 0db3be7d83 fix: revert TypedDict keys to int (Pydantic validates at runtime)
Pydantic enforces response types before JSON serialization, so the
Python dict must use int keys to match the actual data. JSON handles
the int-to-string conversion automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:14:03 -04:00

23 lines
441 B
Python

from typing import TypedDict
class MetadataCoverageItem(TypedDict):
source: str
matched: int
class RegionBreakdownItem(TypedDict):
region: str
count: int
class StatsReturn(TypedDict):
PLATFORMS: int
ROMS: int
SAVES: int
STATES: int
SCREENSHOTS: int
TOTAL_FILESIZE_BYTES: int
METADATA_COVERAGE: dict[int, list[MetadataCoverageItem]]
REGION_BREAKDOWN: dict[int, list[RegionBreakdownItem]]