feat: Add TTS statistics endpoint and service method for comprehensive TTS data
This commit is contained in:
@@ -41,6 +41,21 @@ async def get_track_statistics(
|
||||
) from e
|
||||
|
||||
|
||||
@router.get("/tts-statistics")
|
||||
async def get_tts_statistics(
|
||||
_current_user: Annotated[User, Depends(get_current_user)],
|
||||
dashboard_service: Annotated[DashboardService, Depends(get_dashboard_service)],
|
||||
) -> dict[str, Any]:
|
||||
"""Get TTS statistics."""
|
||||
try:
|
||||
return await dashboard_service.get_tts_statistics()
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail=f"Failed to fetch TTS statistics: {e!s}",
|
||||
) from e
|
||||
|
||||
|
||||
@router.get("/top-sounds")
|
||||
async def get_top_sounds(
|
||||
_current_user: Annotated[User, Depends(get_current_user)],
|
||||
|
||||
Reference in New Issue
Block a user