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

@@ -32,7 +32,7 @@ async def get_playlist_service(
@router.get("/")
async def get_all_playlists(
async def get_all_playlists( # noqa: PLR0913
current_user: Annotated[User, Depends(get_current_active_user_flexible)], # noqa: ARG001
playlist_service: Annotated[PlaylistService, Depends(get_playlist_service)],
search: Annotated[
@@ -57,7 +57,7 @@ async def get_all_playlists(
] = 0,
) -> list[dict]:
"""Get all playlists from all users with search and sorting."""
playlists = await playlist_service.search_and_sort_playlists(
return await playlist_service.search_and_sort_playlists(
search_query=search,
sort_by=sort_by,
sort_order=sort_order,
@@ -66,7 +66,6 @@ async def get_all_playlists(
limit=limit,
offset=offset,
)
return playlists
@router.get("/user")