Skip to content

Conversation

@amontariol
Copy link

Description

Adds a new API endpoint /api/v1/queue/next to get information about the next song in the queue.

Motivation

Closes #3614

This addresses the need for applications to preload the next song without parsing the entire queue response. The current /api/v1/queue endpoint returns a large amount of data, and extracting just the next song requires complex parsing.

Changes

  • Added new GET /api/v1/queue/next endpoint
  • Returns next song information (title, videoId, thumbnail, etc.)
  • Returns HTTP 204 when there's no next song
  • Handles edge cases (empty queue, last song, etc.)

Testing

  • ✅ Tested with active queue (returns next song data)
  • ✅ Tested with last song in queue (returns 204)
  • ✅ Tested with empty queue (returns 204)
  • ✅ Verified response format matches API conventions

Example Usage

# Get next song curl http://localhost:9863/api/v1/queue/next # Example response { "title": "Song Title", "videoId": "abc123", "thumbnail": {...}, "lengthText": {...}, "shortBylineText": {...} }
Adds a new API endpoint to get information about the next song in the queue without parsing the full queue response. This addresses the use case described in issue pear-devs#3614 where users need to preload the next song for VR applications and other integrations. Endpoint returns: - HTTP 200 + song data when next song exists - HTTP 204 when at end of queue or queue is empty Closes pear-devs#3614"
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@amontariol amontariol requested a review from Su-Yong December 3, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants