Skip to content

Commit fbe848a

Browse files
committed
Document ordering of the genre split separator
1 parent 9f92207 commit fbe848a

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

beets/autotag/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
)
8888
if not genres:
8989
try:
90-
sep = next(s for s in [", ", "; ", " / "] if s in genre)
90+
sep = next(s for s in ["; ", ", ", " / "] if s in genre)
9191
except StopIteration:
9292
genres = [genre]
9393
else:

beets/library/migrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def separators(self) -> list[str]:
3737
with suppress(ConfigError):
3838
separators.append(beets.config["lastgenre"]["separator"].as_str())
3939

40-
separators.extend([", ", "; ", " / "])
40+
separators.extend(["; ", ", ", " / "])
4141
return unique_list(filter(None, separators))
4242

4343
@contextmanager

docs/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ New features
2626
splitting genre strings and writing the changes to both the database and media
2727
files. No manual action or ``mbsync`` is required.
2828

29+
The ``genre`` field is split by the first separator found in the string, in
30+
the following order of precedence:
31+
32+
1. :doc:`plugins/lastgenre` ``separator`` configuration
33+
2. Semicolon followed by a space
34+
3. Comma followed by a space
35+
4. Slash wrapped by spaces
36+
2937
Bug fixes
3038
~~~~~~~~~
3139

0 commit comments

Comments
 (0)