Skip to content

Feat/check track rights#82

Open
themmm wants to merge 4 commits into
philippe44:mainfrom
themmm:feat/check-track-rights
Open

Feat/check track rights#82
themmm wants to merge 4 commits into
philippe44:mainfrom
themmm:feat/check-track-rights

Conversation

@themmm
Copy link
Copy Markdown

@themmm themmm commented Feb 22, 2026

Disclaimer:

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

Check track rights on album open

Deezer sometimes marks tracks as readable: true in the REST API but returns empty RIGHTS at playback time, causing silent failures (error 2002) for every affected track. This PR adds an opt-in mechanism to detect and suppress those tracks before the user ever tries to play them.

New setting: "Check track availability on album open" (default: off)

When enabled, opening an album triggers an additional song.getListData GW API call for all tracks that passed the readable filter. Any track that has no RIGHTS and no FALLBACK alternative is cached as unplayable and silently removed from the track listing.

Subsequent opens of the same album skip the GW call entirely and serve the filtered result from cache at full speed.

New setting: "Availability cache duration" (default: 24 h)

Controls how long per-track norights entries and the album-checked marker are kept (options: 1 / 6 / 12 / 24 / 48 / 168 h). This TTL is also used by the lazy norights caching path in getTrackUrl, so both code paths share the same setting.

Graceful disable

Turning the option off immediately restores all tracks to visibility — the norights cache is ignored rather than consulted, so no cache expiry wait is needed.

Empty album message

When an album has no playable tracks (due to readable: false filtering or norights caching), the browser UI now shows a localised message instead of a blank list, hinting at regional or subscription licensing as the likely cause.

Dependency

This PR builds on the FALLBACK mechanism introduced in #81 — the FALLBACK field is checked here to decide whether a rights-less track has a playable alternative.

@philippe44 I do not mean to bother you with my pull requests, I just had quite a productive weekend from my perspective. This pull request removes the third inconvenience I had with using Deezer on LMS.

Timo and others added 4 commits February 22, 2026 11:07
Adds two new settings to the Deezer plugin UI:
- check_track_rights (bool, default off): enables GW API prefetch on
  album open to filter unplayable tracks immediately
- rights_cache_ttl (hours, default 24h): controls how long the
  norights cache entries are kept

Includes strings (EN/DE), HTML controls (checkbox + dropdown), and
preference defaults/registration in Plugin.pm and Settings.pm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When check_track_rights is on, albumTracks calls song.getListData for all
remaining tracks after the readable filter. Tracks with RIGHTS:{} and no
FALLBACK are cached as norights (configurable TTL via rights_cache_ttl) and
filtered from the result immediately. A deezer_album_rights_$id key marks
that the check was done for this album, so subsequent opens skip the GW call
and serve the result from cache at full speed.

Also removes the deezer_album_empty mechanism: albums with 0 playable tracks
now always appear in artist listings (just empty), per user preference.

The lazy norights caching in getTrackUrl now uses rights_cache_ttl as well,
so both paths share the same TTL setting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Disabling the option now immediately restores all tracks to visibility,
without waiting for norights cache entries to expire.
Displays a localised textarea in the browser UI instead of an empty
list, hinting at regional/subscription licensing as a likely cause.
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