feat: Add TTS statistics endpoint and service method for comprehensive TTS data
This commit is contained in:
@@ -201,8 +201,8 @@ class SoundRepository(BaseRepository[Sound]):
|
||||
)
|
||||
raise
|
||||
|
||||
async def get_soundboard_statistics(self) -> dict[str, int | float]:
|
||||
"""Get statistics for SDB type sounds."""
|
||||
async def get_soundboard_statistics(self, sound_type: str = "SDB") -> dict[str, int | float]:
|
||||
"""Get statistics for sounds of a specific type."""
|
||||
try:
|
||||
statement = select(
|
||||
func.count(Sound.id).label("count"),
|
||||
@@ -211,7 +211,7 @@ class SoundRepository(BaseRepository[Sound]):
|
||||
func.sum(
|
||||
Sound.size + func.coalesce(Sound.normalized_size, 0),
|
||||
).label("total_size"),
|
||||
).where(Sound.type == "SDB")
|
||||
).where(Sound.type == sound_type)
|
||||
|
||||
result = await self.session.exec(statement)
|
||||
row = result.first()
|
||||
|
||||
Reference in New Issue
Block a user