Files
romm/backend/endpoints/responses/stats.py
cc ce85a26185 fix: skip expensive platform stats on homepage
The /stats endpoint is called on both the homepage and the server stats
page, but only the stats page displays metadata coverage and region
breakdown. Add an `include_platform_stats` query param (default false)
so the homepage avoids the expensive per-platform queries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 17:59:07 -04:00

23 lines
454 B
Python

from typing import TypedDict
class MetadataCoverageItem(TypedDict):
source: str
matched: int
class RegionBreakdownItem(TypedDict):
region: str
count: int
class StatsReturn(TypedDict, total=False):
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]]