Skip to content

Add album lyrics endpoint with Spotify album pagination#2

Open
spacegrey23 wants to merge 1 commit intomainfrom
codex/add-get-/getalbumdata-route
Open

Add album lyrics endpoint with Spotify album pagination#2
spacegrey23 wants to merge 1 commit intomainfrom
codex/add-get-/getalbumdata-route

Conversation

@spacegrey23
Copy link
Owner

Motivation

  • Provide a new API endpoint to fetch lyrics for an entire Spotify album by reusing the existing single-track lyric lookup logic.
  • Support input as either album_url or album_id and handle Spotify API pagination for albums with many tracks.
  • Return a sensible consolidated structure containing album metadata and per-track lyrics and synced lyrics.

Description

  • Added backend/api/spotify/getAlbumTracks.mjs which extracts an album id, fetches album metadata, and pages through https://api.spotify.com/v1/albums/:id/tracks to collect all tracks.
  • Extended backend/api/getLyrics.mjs with buildTrackLyrics (tries getLyricsBySignature, getLyricsByQuery, then getLyricsFromSpotify) and added getAlbumLyrics to aggregate per-track results and return { data: { albumName, imageUrl, tracks } }.
  • Wired the new handler into routes by adding router.get('/getAlbumData', getAlbumLyrics) in backend/api/routes/routes.mjs and exported getAlbumLyrics.

Testing

  • No automated tests were run for these changes.
  • There are no CI or unit-test results to report for this PR.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant