Skip to content

Fix/track fallback resolution#81

Open
themmm wants to merge 2 commits into
philippe44:mainfrom
themmm:fix/track-fallback-resolution
Open

Fix/track fallback resolution#81
themmm wants to merge 2 commits into
philippe44:mainfrom
themmm:fix/track-fallback-resolution

Conversation

@themmm
Copy link
Copy Markdown

@themmm themmm commented Feb 21, 2026

Disclaimer:

All code-changes have been made with Claude-code.

Problem

Some tracks returned by song.getListData (and radio.getUserRadio)
have an empty RIGHTS hash, meaning the primary track version is not
licensed for streaming on the user's account or region. Attempting to
play such a track resulted in error 2002 from the media provider:

"Track token has no sufficient rights on requested media."

The track was then silently skipped.

Root cause

The plugin passed the primary track's TRACK_TOKEN and SNG_ID
directly to _getProviders without checking whether the track actually
has streaming rights.

Solution

When Deezer cannot serve a track, it includes a FALLBACK object in the
API response. This is Deezer's own recommendation: an alternative version
of the same song (different SNG_ID / TRACK_TOKEN) with populated
RIGHTS that can be streamed. The fix checks RIGHTS for each track and
transparently substitutes the FALLBACK where needed.

Applied to both getTrackUrl (on-demand playback) and flowTracks
(Flow / radio mode).

Testing

  1. Find a track that previously failed with error 2002 (e.g. a track
    where FILESIZE_FLAC = 0 and RIGHTS = {} in the gateway response).
  2. Play it – it should now stream using the fallback version.
  3. Verify that tracks with full rights are unaffected.

Timo and others added 2 commits February 21, 2026 13:51
Deezer's song.getListData and radio.getUserRadio APIs sometimes return
tracks with an empty RIGHTS hash (STATUS=3), meaning the primary track
version cannot be streamed on the user's account or region. In these
cases the API also provides a FALLBACK object pointing to an alternative
version that is fully licensed.

Before this fix the plugin passed the primary track token to the media
provider and received error 2002 "Track token has no sufficient rights
on requested media", causing the track to be silently skipped.

Now both getTrackUrl and flowTracks check RIGHTS before using a track
token and switch to the FALLBACK version when rights are absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deezer explicitly provides a FALLBACK entry in the API response when a
track cannot be streamed, pointing to a licensed alternative version.
The comment now makes clear that FALLBACK is Deezers own suggestion,
not a workaround.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@themmm themmm mentioned this pull request Feb 22, 2026
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