feat: Add favorites filtering to sound retrieval; include user-specific favorite sounds in the API response

This commit is contained in:
JSC
2025-08-16 21:27:40 +02:00
parent a947fd830b
commit 78508c84eb
2 changed files with 19 additions and 1 deletions

View File

@@ -70,6 +70,10 @@ async def get_sounds( # noqa: PLR0913
int,
Query(description="Number of results to skip", ge=0),
] = 0,
favorites_only: Annotated[
bool,
Query(description="Show only favorited sounds"),
] = False,
) -> SoundsListResponse:
"""Get sounds with optional search, filtering, and sorting."""
try:
@@ -80,6 +84,8 @@ async def get_sounds( # noqa: PLR0913
sort_order=sort_order,
limit=limit,
offset=offset,
favorites_only=favorites_only,
user_id=current_user.id,
)
# Add favorite indicators for each sound