Skip to content

feat: Add genres config option to write main genre, sub-genre, or both#40

Merged
Samik081 merged 3 commits into
mainfrom
feat/issue-37-genres-config
Jul 10, 2026
Merged

feat: Add genres config option to write main genre, sub-genre, or both#40
Samik081 merged 3 commits into
mainfrom
feat/issue-37-genres-config

Conversation

@Samik081

Copy link
Copy Markdown
Owner

Adds a genres config option (sub | main | both, default sub) controlling which Beatport genre fields are written to beets' multi-value genres field.

  • sub (default): sub-genre, falling back to the main genre — exactly the current behavior
  • main: always the main genre
  • both: main genre first, then sub-genre

BeatportTrack now keeps genre and sub_genre as separate fields; the selection happens in the plugin (_get_genres()), validated via confuse as_choice, so an invalid value fails loudly instead of silently mistagging.

Verified end-to-end against the live Beatport API with track 16772903 from the issue (Trance (Main Floor) / Hard Trance): track_for_id returns both genres in order, a real singleton beet import --search-id writes genres: Trance (Main Floor); Hard Trance to the library, and the file itself carries both values as multi-value genre tags. The default mode was also live-verified to keep today's behavior.

Fixes #37

@Samik081 Samik081 changed the title Add genres config option to write main genre, sub-genre, or both feat: Add genres config option to write main genre, sub-genre, or both Jul 10, 2026
@Samik081
Samik081 merged commit 148f7d6 into main Jul 10, 2026
12 checks passed
@Samik081
Samik081 deleted the feat/issue-37-genres-config branch July 10, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET both genre and sub-genres

1 participant