Feat/check track rights#82
Open
themmm wants to merge 4 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclaimer:
All code-changes have been made with Claude-code.
Check track rights on album open
Deezer sometimes marks tracks as
readable: truein the REST API but returns emptyRIGHTSat 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.getListDataGW API call for all tracks that passed thereadablefilter. Any track that has noRIGHTSand noFALLBACKalternative 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: falsefiltering 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
FALLBACKfield 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.