Skip to content

Commit

Permalink
Include lower-casing in _get_existing already
Browse files Browse the repository at this point in the history
since we don't use it for early-returning no-force-existing genres
anymore.
  • Loading branch information
JOJ0 committed Jan 21, 2025
1 parent 22702c2 commit 0f9054e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions beetsplug/lastgenre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ def _get_existing_genres(self, obj: Union[Album, Item]) -> list[str]:
else:
genre_str = obj.get("genre")

return genre_str.split(self.config["separator"].get())
return [
g.lower() for g in genre_str.split(self.config["separator"].get())
]

def _combine_genres(
self, old: list[str], new: list[str]
Expand Down Expand Up @@ -344,11 +346,10 @@ def _get_genre(
return obj.get("genre"), "keep, no-force"

if self.config["force"]:
genres = self._get_existing_genres(obj)
# Force doesn't keep any unless keep_existing is set.
# Whitelist validation is handled in _resolve_genres.
if self.config["keep_existing"]:
keep_genres = [g.lower() for g in genres]
keep_genres = self._get_existing_genres(obj)

# Run through stages: track, album, artist,
# album artist, or most popular track genre.
Expand Down

0 comments on commit 0f9054e

Please sign in to comment.