mirror of
https://github.com/beetbox/beets.git
synced 2026-02-19 22:03:05 +01:00
Fix lastgenre migration separator logic (ref https://github.com/beetbox/beets/pull/6169#issuecomment-3716893013)
This commit is contained in:
parent
9fbf0edd75
commit
7f15e1b8e2
1 changed files with 20 additions and 1 deletions
|
|
@ -196,7 +196,26 @@ class Library(dbcore.Database):
|
|||
needs_migration = False
|
||||
split_genres = []
|
||||
if not genres_val and genre_val:
|
||||
for separator in [", ", "; ", " / "]:
|
||||
separators = []
|
||||
if (
|
||||
"lastgenre" in beets.config
|
||||
and "separator" in beets.config["lastgenre"]
|
||||
):
|
||||
try:
|
||||
user_sep = beets.config["lastgenre"][
|
||||
"separator"
|
||||
].as_str()
|
||||
if user_sep:
|
||||
separators.append(user_sep)
|
||||
except (
|
||||
beets.config.ConfigNotFoundError,
|
||||
beets.config.ConfigTypeError,
|
||||
):
|
||||
pass
|
||||
|
||||
separators.extend([", ", "; ", " / "])
|
||||
|
||||
for separator in separators:
|
||||
if separator in genre_val:
|
||||
split_genres = [
|
||||
g.strip()
|
||||
|
|
|
|||
Loading…
Reference in a new issue