feat: Add unique constraint on sound hash and update related tests

This commit is contained in:
JSC
2025-07-30 21:43:27 +02:00
parent e43650c26c
commit 974fb05087
5 changed files with 33 additions and 20 deletions

View File

@@ -116,7 +116,7 @@ class SoundRepository:
async def get_popular_sounds(self, limit: int = 10) -> list[Sound]:
"""Get the most played sounds."""
try:
statement = select(Sound).order_by(desc(Sound.play_count)).limit(limit)
statement = select(Sound).order_by(Sound.play_count.desc()).limit(limit)
result = await self.session.exec(statement)
return list(result.all())
except Exception: