refactor: Improve exception handling and logging in authentication and playlist services; enhance code readability and structure
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user