refactor: Improve exception handling and logging in authentication and playlist services; enhance code readability and structure
All checks were successful
Backend CI / lint (push) Successful in 9m21s
Backend CI / test (push) Successful in 4m18s

This commit is contained in:
JSC
2025-08-13 00:04:55 +02:00
parent f094fbf140
commit bee1076239
14 changed files with 144 additions and 66 deletions

View File

@@ -33,9 +33,18 @@ async def get_track_statistics(
async def get_top_sounds(
_current_user: Annotated[User, Depends(get_current_user)],
dashboard_service: Annotated[DashboardService, Depends(get_dashboard_service)],
sound_type: Annotated[str, Query(description="Sound type filter (SDB, TTS, EXT, or 'all')")],
period: Annotated[str, Query(description="Time period (today, 1_day, 1_week, 1_month, 1_year, all_time)")] = "all_time",
limit: Annotated[int, Query(description="Number of top sounds to return", ge=1, le=100)] = 10,
sound_type: Annotated[
str, Query(description="Sound type filter (SDB, TTS, EXT, or 'all')"),
],
period: Annotated[
str,
Query(
description="Time period (today, 1_day, 1_week, 1_month, 1_year, all_time)",
),
] = "all_time",
limit: Annotated[
int, Query(description="Number of top sounds to return", ge=1, le=100),
] = 10,
) -> list[dict[str, Any]]:
"""Get top sounds by play count for a specific period."""
return await dashboard_service.get_top_sounds(