mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Revert "Simplify _get_existing_genres()"
This reverts commit 7ff06df17c.
This was here for a reason: Ab empty string genre should als become an
empty list!
This commit is contained in:
parent
4f0837c724
commit
6530d76319
1 changed files with 6 additions and 3 deletions
|
|
@ -298,12 +298,15 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
|
||||
def _get_existing_genres(self, obj: Union[Album, Item]) -> list[str]:
|
||||
"""Return a list of genres for this Item or Album."""
|
||||
separator = self.config["separator"].get()
|
||||
if isinstance(obj, library.Item):
|
||||
genre_str = obj.get("genre", with_album=False)
|
||||
item_genre = obj.get("genre", with_album=False).split(separator)
|
||||
else:
|
||||
genre_str = obj.get("genre")
|
||||
item_genre = obj.get("genre").split(separator)
|
||||
|
||||
return genre_str.split(self.config["separator"].get())
|
||||
if any(item_genre):
|
||||
return item_genre
|
||||
return []
|
||||
|
||||
def _combine_genres(
|
||||
self, old: list[str], new: list[str]
|
||||
|
|
|
|||
Loading…
Reference in a new issue