refactor: Rename global current playlist methods for clarity and consistency

This commit is contained in:
JSC
2025-08-01 17:12:56 +02:00
parent c0f51b2e23
commit 0575d12b0e
6 changed files with 33 additions and 104 deletions

View File

@@ -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")