Skip to content

Swap Discogs genres and styles#6478

Open
snejus wants to merge 2 commits intomasterfrom
discogs-swap-genres-style
Open

Swap Discogs genres and styles#6478
snejus wants to merge 2 commits intomasterfrom
discogs-swap-genres-style

Conversation

@snejus
Copy link
Copy Markdown
Member

@snejus snejus commented Mar 31, 2026

discogs: Swap genre and style field mapping

Fixes #6390

Fixes the semantic mismatch between Discogs' taxonomy and beets' fields. In Discogs, genres are broad (e.g. "Electronic") and styles are specific (e.g. "Techno"). Previously, beets stored them the wrong way around.

What changed

In get_album_info, the source fields are swapped:

  • genres (beets) now reads from Discogs styles — the specific values
  • style (beets) now reads from Discogs genres — the broader values

The append_style_genre config option retains its original intent: append broader style values to genres when enabled. Only the data source for each field changed, not the logic.

@snejus snejus requested a review from a team as a code owner March 31, 2026 00:31
Copilot AI review requested due to automatic review settings March 31, 2026 00:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

PR swap Discogs genre/style mapping so beets fields match Discogs meaning: Discogs genres are broad, Discogs styles are specific.

Changes:

  • In Discogs plugin, read beets genres from Discogs styles, and beets style from Discogs genres.
  • Update Discogs plugin tests to cover the swapped mapping.
  • Update Discogs plugin docs + changelog entry for new mapping.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
beetsplug/discogs/__init__.py Swap Discogs genres/styles inputs when building AlbumInfo.style and AlbumInfo.genres.
test/plugins/test_discogs.py Adjust release fixture + assertions for swapped mapping; rename one test.
docs/plugins/discogs.rst Update append_style_genre + separator docs to describe new semantics.
docs/changelog.rst Add changelog entry describing the Discogs mapping change.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.06%. Comparing base (131768b) to head (1de757f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6478   +/-   ##
=======================================
  Coverage   70.06%   70.06%           
=======================================
  Files         147      147           
  Lines       18562    18562           
  Branches     3026     3026           
=======================================
  Hits        13005    13005           
  Misses       4924     4924           
  Partials      633      633           
Files with missing lines Coverage Δ
beetsplug/discogs/__init__.py 67.28% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

@JOJ0
Copy link
Copy Markdown
Member

JOJ0 commented Apr 1, 2026

those tiny copilot suggestions seem valid, other than that LGTM

@snejus
Copy link
Copy Markdown
Member Author

snejus commented Apr 3, 2026

those tiny copilot suggestions seem valid

I'm not sure about this - there is inherent confusion because we are swapping genres and styles around in the incoming Discogs data.

I doubt that this is a good suggestion
image

😁

@JOJ0
Copy link
Copy Markdown
Member

JOJ0 commented Apr 3, 2026

those tiny copilot suggestions seem valid

I'm not sure about this - there is inherent confusion because we are swapping genres and styles around in the incoming Discogs data.

I doubt that this is a good suggestion

image

😁

Brrr yeah all this is very confusing. But this suggested sentence is the more confusing one, I agree

I try to give all these sentences another look, maybe can be even more clarified. hopefully find time tomorrow (other plans)

@snejus snejus force-pushed the discogs-swap-genres-style branch from 69af3cc to 1de757f Compare April 3, 2026 23:49
@JOJ0 JOJ0 added the plugin Pull requests that are plugins related label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin Pull requests that are plugins related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discogs: consider styles as genre

3 participants