Document ordering of the genre split separator

This commit is contained in:
Šarūnas Nejus 2026-02-22 12:42:19 +00:00
parent 67cf15b0bd
commit 62e232983a
No known key found for this signature in database
3 changed files with 10 additions and 2 deletions

View file

@ -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:

View file

@ -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

View file

@ -28,6 +28,14 @@ New features
command that writes tags (such as ``beet write`` or during import). 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
~~~~~~~~~