Skip to content

Commit

Permalink
Add albumtypes list field in Discogs plugin
Browse files Browse the repository at this point in the history
and derive single field albumtype from it. FIXME this reverts to a solution
before get_media_and_albumtype helper was introduced.
  • Loading branch information
JOJ0 committed Dec 14, 2024
1 parent efffcd7 commit fb18c62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions beetsplug/discogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,12 @@ def get_album_info(self, result):

# Extract information for the optional AlbumInfo fields that are
# contained on nested discogs fields.
media, albumtype = self.get_media_and_albumtype(
result.data.get("formats")
)
albumtypes = albumtype = media = label = catalogno = labelid = None
if result.data.get("formats"):
albumtypes = result.data["formats"][0].get("descriptions", [])
if len(albumtypes) > 0:
albumtype = albumtypes[0]
media = result.data["formats"][0]["name"]

label = catalogno = labelid = None
if result.data.get("labels"):
Expand Down Expand Up @@ -478,6 +481,7 @@ def get_album_info(self, result):
artist=artist,
artist_id=artist_id,
tracks=tracks,
albumtypes=albumtypes,
albumtype=albumtype,
va=va,
year=year,
Expand Down

0 comments on commit fb18c62

Please sign in to comment.