Skip to content

fix(eternal-jukebox): fall back to equivalent track analysis#94

Open
urroxyz wants to merge 1 commit into
Pithaya:mainfrom
urroxyz:fix/eternal-jukebox-analysis-fallback
Open

fix(eternal-jukebox): fall back to equivalent track analysis#94
urroxyz wants to merge 1 commit into
Pithaya:mainfrom
urroxyz:fix/eternal-jukebox-analysis-fallback

Conversation

@urroxyz

@urroxyz urroxyz commented Jul 5, 2026

Copy link
Copy Markdown

I was looping my favorite song with Eternal Jukebox and enjoying it. But later, when trying the same track, Eternal Jukebox just hung indefinitely.

Turns out that Spotify was returning a 404 in the background and the app didn't know how to handle it. The former is simply because Spotify has multiple IDs for a track since some tracks are released/distributed multiple times. This is a fix for the latter.

Summary

  • Validate the value returned by Spicetify.getAudioData before using it.
  • When the current Spotify catalog ID has no audio analysis, search for equivalent releases with the same normalized title and primary artist.
  • Only accept alternate tracks whose catalog and analysis durations are within 1.5 seconds of the playing track.
  • Probe at most eight candidates and show a notification when alternate analysis is used.
  • Fail cleanly when no usable analysis exists instead of leaving the Jukebox enabled without song state.

Problem

Spicetify.getAudioData can resolve to an HTTP error object such as:

{ code: 404, message: "Failed to fetch" }

Because that object is truthy, Eternal Jukebox treated it as valid analysis and then crashed while reading analysis.beats.length. Spotify can also assign a new catalog ID to an existing recording without copying its audio analysis, even when another release of the same recording still has valid beat and segment data.

Solution

The Jukebox now validates all arrays required by the remixer. If the current ID has no usable analysis, it searches Spotify for exact title/artist matches, ranks candidates by duration difference, and accepts only tightly duration-matched analysis.

Testing

  • TypeScript check passes: tsc --noEmit
  • Production custom-app build succeeds: spicetify-creator --out=dist --minify
  • Reproduced with spotify:track:6st8aj6PmtqGctnLAat95M (Life Goes On by The Sundays), whose direct analysis request returns 404
  • Confirmed the fallback loads 464 beats and renders the Jukebox graph
  • Confirmed a normally analyzed control track still uses the direct path and returns 833 beats / 1,095 segments

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant