Simplify MusicBrainz genres assignment

Remove intermediate variable and assign directly to info.genres.
Addresses PR review comment.
This commit is contained in:
dunkla 2025-12-28 20:48:15 +01:00 committed by Šarūnas Nejus
parent 85903804ef
commit 9597075751
No known key found for this signature in database

View file

@ -644,11 +644,10 @@ class MusicBrainzPlugin(MusicBrainzAPIMixin, MetadataSourcePlugin):
for source in sources:
for genreitem in source:
genres[genreitem["name"]] += int(genreitem["count"])
genre_list = [
info.genres = [
genre
for genre, _count in sorted(genres.items(), key=lambda g: -g[1])
]
info.genres = genre_list
# We might find links to external sources (Discogs, Bandcamp, ...)
external_ids = self.config["external_ids"].get()