Skip to content

Commit

Permalink
fix: prepend electronic sub genre if strong match
Browse files Browse the repository at this point in the history
when strong probability
  • Loading branch information
mgoltzsche committed Jan 13, 2024
1 parent 75c5628 commit 6d9ee3c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions beetsplug/autogenre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,15 @@ def _essentia_genre(self, item):
# Use the result of Essentia's electronic genre model
genre = ELECTRONIC_GENRES.get(genre_electronic)
elif genre_rosamerica_probability < genre_rosamerica_strong and genre_electronic_probability > genre_electronic_prepend:
# Prepend Electronic to genre list
# Prepend electronic to genre list
genres = ['electronic'] + [genre]
genre_electro = ELECTRONIC_GENRES.get(genre_electronic)
if genre_electro:
genres += [genre_electro]
if genre_electronic_probability > genre_electronic_strong:
# Prepend concrete electronic sub genre to list
genres = [genre_electro] + genres
else: # Append electronic sub genre to list
genres += [genre_electro]
genre = self._list2str(genres)

if genre_electronic_probability > genre_electronic_append:
Expand Down

0 comments on commit 6d9ee3c

Please sign in to comment.