mirror of
https://github.com/beetbox/beets.git
synced 2026-02-18 13:25:06 +01:00
Use compact generator expression in Beatport (ref https://github.com/beetbox/beets/pull/6169#issuecomment-3716893013)
This commit is contained in:
parent
7f15e1b8e2
commit
c67dea2adb
1 changed files with 4 additions and 8 deletions
|
|
@ -306,14 +306,10 @@ class BeatportTrack(BeatportObject):
|
|||
self.initial_key = str((data.get("key") or {}).get("shortName"))
|
||||
|
||||
# Extract genres list from subGenres or genres
|
||||
if data.get("subGenres"):
|
||||
genre_list = [str(x.get("name")) for x in data["subGenres"]]
|
||||
elif data.get("genres"):
|
||||
genre_list = [str(x.get("name")) for x in data["genres"]]
|
||||
else:
|
||||
genre_list = []
|
||||
|
||||
self.genres = unique_list(genre_list)
|
||||
self.genres = unique_list(
|
||||
str(x.get("name"))
|
||||
for x in data.get("subGenres") or data.get("genres") or []
|
||||
)
|
||||
|
||||
|
||||
class BeatportPlugin(MetadataSourcePlugin):
|
||||
|
|
|
|||
Loading…
Reference in a new issue