Document ordering of the genre split separator

This commit is contained in:
Šarūnas Nejus 2026-02-22 12:42:19 +00:00
parent 1b326ea5dc
commit 151468ee37
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

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