refactor: Rename global current playlist methods for clarity and consistency
This commit is contained in:
@@ -221,18 +221,18 @@ async def set_current_playlist(
|
||||
current_user: Annotated[User, Depends(get_current_active_user_flexible)], # noqa: ARG001
|
||||
playlist_service: Annotated[PlaylistService, Depends(get_playlist_service)],
|
||||
) -> PlaylistResponse:
|
||||
"""Set a playlist as the global current playlist."""
|
||||
playlist = await playlist_service.set_current_playlist_global(playlist_id)
|
||||
"""Set a playlist as the current playlist."""
|
||||
playlist = await playlist_service.set_current_playlist(playlist_id)
|
||||
return PlaylistResponse.from_playlist(playlist)
|
||||
|
||||
|
||||
@router.delete("/current")
|
||||
async def unset_current_playlist(
|
||||
current_user: Annotated[User, Depends(get_current_active_user_flexible)], # noqa: ARG001
|
||||
current_user: Annotated[User, Depends(get_current_active_user_flexible)], # noqa: ARG001
|
||||
playlist_service: Annotated[PlaylistService, Depends(get_playlist_service)],
|
||||
) -> MessageResponse:
|
||||
"""Unset the global current playlist."""
|
||||
await playlist_service.unset_current_playlist_global()
|
||||
"""Unset the current playlist."""
|
||||
await playlist_service.unset_current_playlist()
|
||||
return MessageResponse(message="Current playlist unset successfully")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user