mirror of
https://github.com/rommapp/romm.git
synced 2026-02-19 07:50:57 +01:00
24 lines
670 B
Python
24 lines
670 B
Python
from endpoints.responses.stats import StatsReturn
|
|
from fastapi import APIRouter
|
|
from handler import db_stats_handler
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/stats")
|
|
def stats() -> StatsReturn:
|
|
"""Endpoint to return the current RomM stats
|
|
|
|
Returns:
|
|
dict: Dictionary with all the stats
|
|
"""
|
|
|
|
return {
|
|
"PLATFORMS": db_stats_handler.get_platforms_count(),
|
|
"ROMS": db_stats_handler.get_roms_count(),
|
|
"SAVES": db_stats_handler.get_saves_count(),
|
|
"STATES": db_stats_handler.get_states_count(),
|
|
"SCREENSHOTS": db_stats_handler.get_screenshots_count(),
|
|
"FILESIZE": db_stats_handler.get_total_filesize(),
|
|
}
|