Use separator as configured instead of hardcoding

in lastgenre plugin.
This commit is contained in:
J0J0 Todos 2023-11-16 16:05:16 +01:00
parent 517c037c25
commit fe466f4bb3

View file

@ -316,13 +316,14 @@ class LastGenrePlugin(plugins.BeetsPlugin):
# Shortcut to existing genre if not forcing.
if not self.config["force"]:
separator = self.config["separator"].get()
if isinstance(obj, library.Item):
genres = obj.get("genre", with_album=False).split(", ")
genres = obj.get("genre", with_album=False).split(separator)
else:
genres = obj.get("genre").split(", ")
genres = obj.get("genre").split(separator)
keep_allowed = set([g for g in genres if self._is_allowed(g)])
if keep_allowed:
return ", ".join(keep_allowed), "keep"
return separator.join(keep_allowed), "keep"
# Track genre (for Items only).
if isinstance(obj, library.Item):