Skip to content

Add multi-valued genres field#6391

Closed
Copilot wants to merge 1 commit intoadd-multiple-genresfrom
copilot/sub-pr-6367
Closed

Add multi-valued genres field#6391
Copilot wants to merge 1 commit intoadd-multiple-genresfrom
copilot/sub-pr-6367

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 23, 2026

Description

Replaces singular genre field with multi-valued genres field to eliminate synchronization issues between singular/plural fields that caused repeated retagging operations.

Key changes:

  • Database migration infrastructure: New migrations table tracks completed migrations. genregenres migration runs once on first invocation, splitting on common separators (, , ; , /) with precedence order - only the first matching separator is used per genre string.

  • Metadata source updates: MusicBrainz, Beatport, Discogs, and LastGenre plugins now populate genres list field instead of singular genre string.

  • Template function enhancement: %first template function now splits on \x00 (multi-value delimiter) by default for seamless genre list handling.

  • Deprecation handling: Metadata sources passing deprecated genre parameter automatically split on known separators with deprecation warning.

  • Backward compatibility: Old genre database column remains intact but ignored, allowing rollback to older beets versions without data loss.

Migration behavior:

  • Only migrates rows where genre is non-empty and genres is empty
  • Uses SQL for performance (~2s vs 11min for 9000 tracks)
  • Resumes if interrupted (CTRL-C safe)

Separator precedence:
When splitting existing genre strings, the first matching separator determines the split:

  • "Rock; Pop, Jazz"["Rock", " Pop, Jazz"] (splits on ; only)
  • "Rock - Alt, Indie"["Rock", "Alt, Indie"] (splits on - only)

This ensures deterministic migration but means mixed-separator genres may need manual cleanup post-migration.

To Do

  • Documentation.
  • Changelog.
  • Tests.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI mentioned this pull request Feb 23, 2026
Copilot AI changed the title [WIP] Add support for a multi-valued genres field Add multi-valued genres field Feb 23, 2026
Copilot AI requested a review from snejus February 23, 2026 04:07
@snejus snejus closed this Feb 23, 2026
@snejus snejus deleted the copilot/sub-pr-6367 branch February 23, 2026 04:11
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.

3 participants