PR feedback: fix formatting

This commit is contained in:
U-LAPTOP-4EP3DB2K\alexa 2023-10-23 09:47:19 +08:00
parent 3e06ca2af4
commit 5fe19c1d1d
2 changed files with 6 additions and 6 deletions

View file

@ -476,17 +476,17 @@ class DiscogsPlugin(BeetsPlugin):
discogs_albumid=discogs_albumid,
discogs_labelid=labelid,
discogs_artistid=artist_id,
cover_art_url=cover_art_url
cover_art_url=cover_art_url,
)
def select_cover_art(self, result):
"""Returns the best candidate image, if any, from a Discogs `Release` object."""
if result.data.get("images") and len(result.data.get("images")) > 0:
# The first image in this list appears to be the one displayed first
# on the release page - even if it is not flagged as `type: "primary"` - and
# The first image in this list appears to be the one displayed first
# on the release page - even if it is not flagged as `type: "primary"` - and
# so it is the best candidate for the cover art.
return result.data.get("images")[0].get("uri")
return None
def format(self, classification):

View file

@ -1098,7 +1098,7 @@ class CoverArtUrl(RemoteArtSource):
image_url = None
try:
# look for cover_art_url on album or first track
if album.get('cover_art_url'):
if album.get("cover_art_url"):
image_url = album.cover_art_url
else:
image_url = album.items().get().cover_art_url