Skip to content

fix(deezer): detect compilations credited to a single main artist - #6899

Open
cycsmail wants to merge 2 commits into
beetbox:masterfrom
cycsmail:deezer-compilation-detection-4057
Open

fix(deezer): detect compilations credited to a single main artist#6899
cycsmail wants to merge 2 commits into
beetbox:masterfrom
cycsmail:deezer-compilation-detection-4057

Conversation

@cycsmail

@cycsmail cycsmail commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #4057.

Deezer credits some compilations to a single "main" artist instead of the Various Artists entity, so beets never flagged them as VA and ended up dumping every track artist into the album artist field. This treats a release as a compilation when its album artist only performs on a minority of the tracks, in addition to the existing Various Artists id check.

Added two tests for the deezer plugin (a compilation credited to a single artist, and a normal single-artist album that should not be flagged); both pass locally.

To Do

  • Documentation. No user-facing options changed.
  • Changelog.
  • Tests.

@cycsmail
cycsmail requested a review from a team as a code owner August 1, 2026 15:55
@github-actions github-actions Bot added the deezer deezer plugin label Aug 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b26ca16125

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread beetsplug/deezer.py Outdated
Comment on lines +119 to +120
sum(t.artist_id == album_artist_id for t in tracks) * 2
< len(tracks)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the existing VA threshold for Deezer

When using Deezer metadata for albums credited to an artist who appears on 25–49% of the tracks (for example, 2 of 5 tracks with other guests), this new < len(tracks) / 2 check sets va=True; AlbumInfo maps va to comp (beets/autotag/hooks.py:287), so those releases import under the compilation/Various Artists path. The importer’s own fallback keeps albums single-artist when the plurality is at least SINGLE_ARTIST_THRESH = 0.25 (beets/importer/tasks.py:35 and :606-609), so this heuristic is much more aggressive than the rest of beets and can retag legitimate single-artist/featured albums as compilations; use that existing threshold or require a stricter compilation signal.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.88%. Comparing base (efc8970) to head (12d5ba5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6899      +/-   ##
==========================================
+ Coverage   75.68%   75.88%   +0.20%     
==========================================
  Files         163      163              
  Lines       21423    21425       +2     
  Branches     3387     3387              
==========================================
+ Hits        16213    16259      +46     
+ Misses       4410     4357      -53     
- Partials      800      809       +9     
Files with missing lines Coverage Δ
beetsplug/deezer.py 41.25% <100.00%> (+22.81%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cycsmail

cycsmail commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Good catch on the threshold, it was stricter than what beets itself uses for this. Switched it to reuse SINGLE_ARTIST_THRESH from the importer so a plurality artist at 25%+ stays single-artist, and added a test for the 40% case. Also fixed the docs check failure (changelog formatting) and moved the entry back under Unreleased after the 2.13 release.

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.

beets fails to detect compilations when importing metadata from Deezer

1 participant