From 151468ee379336e2c457f13efe55ea84fcaae91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Sun, 22 Feb 2026 12:42:19 +0000 Subject: [PATCH] Document ordering of the genre split separator --- beets/autotag/hooks.py | 2 +- beets/library/migrations.py | 2 +- docs/changelog.rst | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py index 38d72fbb9..6c2f53f0a 100644 --- a/beets/autotag/hooks.py +++ b/beets/autotag/hooks.py @@ -87,7 +87,7 @@ class Info(AttrDict[Any]): ) if not genres: try: - sep = next(s for s in [", ", "; ", " / "] if s in genre) + sep = next(s for s in ["; ", ", ", " / "] if s in genre) except StopIteration: genres = [genre] else: diff --git a/beets/library/migrations.py b/beets/library/migrations.py index 16f4c6761..c061ddfc5 100644 --- a/beets/library/migrations.py +++ b/beets/library/migrations.py @@ -37,7 +37,7 @@ class MultiGenreFieldMigration(Migration): with suppress(ConfigError): separators.append(beets.config["lastgenre"]["separator"].as_str()) - separators.extend([", ", "; ", " / "]) + separators.extend(["; ", ", ", " / "]) return unique_list(filter(None, separators)) @contextmanager diff --git a/docs/changelog.rst b/docs/changelog.rst index b123a157a..822d25f47 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -26,6 +26,14 @@ New features splitting genre strings and writing the changes to both the database and media files. No manual action or ``mbsync`` is required. + The ``genre`` field is split by the first separator found in the string, in + the following order of precedence: + + 1. :doc:`plugins/lastgenre` ``separator`` configuration + 2. Semicolon followed by a space + 3. Comma followed by a space + 4. Slash wrapped by spaces + Bug fixes ~~~~~~~~~