Skip to content

fix(deezer): use free text for singleton searches - #6895

Open
pszpetkowski wants to merge 1 commit into
beetbox:masterfrom
pszpetkowski:master
Open

fix(deezer): use free text for singleton searches#6895
pszpetkowski wants to merge 1 commit into
beetbox:masterfrom
pszpetkowski:master

Conversation

@pszpetkowski

Copy link
Copy Markdown

Description

Singleton searches built the query as <title> artist:"<artist>". Deezer discards unquoted free text as soon as a query contains any field:"value" filter, so that was evaluated as artist:"<artist>" alone - every track by the artist, in Deezer's own relevance order, truncated to search_limit (default 5). Substituting nonsense for the title returns a byte-identical result set. For any artist with more releases than that window, the track being imported was simply never among the candidates offered.

Filtering on the title as well (track:"<title>" artist:"<artist>") is not a fix: artist: matches loosely enough to return unrelated artists, so the two filters can intersect to nothing even for a correctly tagged file. track:"Get Lucky" artist:"Daft Punk" returns zero results, while the plain free text Get Lucky Daft Punk returns the right track first.

Measured over 12 tracks at the default search_limit, counting the wanted track appearing anywhere in the results:

  <title> artist:"..."              6/12, mean rank 1.50
  track:"..." artist:"..."          7/12, mean rank 1.00
  free text                        10/12, mean rank 1.00

Album searches are unchanged; album:"<name>" has no equivalent problem.

Adds test/plugins/test_deezer.py, which did not exist.

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

@pszpetkowski
pszpetkowski requested a review from a team as a code owner July 30, 2026 19:15
@github-actions github-actions Bot added the deezer deezer plugin label Jul 30, 2026
Singleton searches built the query as `<title> artist:"<artist>"`. Deezer
discards unquoted free text as soon as a query contains any field:"value"
filter, so that was evaluated as `artist:"<artist>"` alone - every track by
the artist, in Deezer's own relevance order, truncated to `search_limit`
(default 5). Substituting nonsense for the title returns a byte-identical
result set. For any artist with more releases than that window, the track
being imported was simply never among the candidates offered.

Filtering on the title as well (`track:"<title>" artist:"<artist>"`) is not
a fix: `artist:` matches loosely enough to return unrelated artists, so the
two filters can intersect to nothing even for a correctly tagged file.
`track:"Get Lucky" artist:"Daft Punk"` returns zero results, while the plain
free text `Get Lucky Daft Punk` returns the right track first.

Measured over 12 tracks at the default `search_limit`, counting the wanted
track appearing anywhere in the results:

  `<title> artist:"..."`              6/12, mean rank 1.50
  `track:"..." artist:"..."`          7/12, mean rank 1.00
  free text                          10/12, mean rank 1.00

Album searches are unchanged; `album:"<name>"` has no equivalent problem.

Adds test/plugins/test_deezer.py, which did not exist.
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.63%. Comparing base (4240594) to head (681f27f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6895      +/-   ##
==========================================
+ Coverage   75.61%   75.63%   +0.02%     
==========================================
  Files         163      163              
  Lines       21323    21325       +2     
  Branches     3363     3364       +1     
==========================================
+ Hits        16124    16130       +6     
+ Misses       4406     4402       -4     
  Partials      793      793              
Files with missing lines Coverage Δ
beetsplug/deezer.py 22.37% <100.00%> (+3.93%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread beetsplug/deezer.py

@semohr semohr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Labels

deezer deezer plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants