fix(deezer): detect compilations credited to a single main artist - #6899
fix(deezer): detect compilations credited to a single main artist#6899cycsmail wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 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".
| sum(t.artist_id == album_artist_id for t in tracks) * 2 | ||
| < len(tracks) |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
|
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. |
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.