mirror of
https://github.com/beetbox/beets.git
synced 2026-01-27 18:43:50 +01:00
lastgenre: Use multi-valued albumartists field
In case the albumartist genre can't be found (often due to variations of artist-combination wording issues, eg "featuring", "+", "&" and so on) use the albumartists list field, fetch a genre for each artist separately and concatenate them.
This commit is contained in:
parent
d4d93504b1
commit
1045d9ae9b
1 changed files with 13 additions and 0 deletions
|
|
@ -422,6 +422,19 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
elif obj.albumartist != config["va_name"].as_str():
|
||||
new_genres = self.fetch_artist_genre(obj.albumartist)
|
||||
stage_label = "album artist"
|
||||
if not new_genres:
|
||||
self._tunelog(
|
||||
'No album artist genre found for "{}", '
|
||||
"trying multi-valued field...",
|
||||
obj.albumartist,
|
||||
)
|
||||
for albumartist in obj.albumartists:
|
||||
self._tunelog(
|
||||
'Fetching artist genre for "{}"', albumartist
|
||||
)
|
||||
new_genres += self.fetch_artist_genre(albumartist)
|
||||
if new_genres:
|
||||
stage_label = "multi-valued album artist"
|
||||
else:
|
||||
# For "Various Artists", pick the most popular track genre.
|
||||
item_genres = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue