good
This commit is contained in:
parent
5265391ae4
commit
fc4a39ab8c
2 changed files with 4 additions and 5 deletions
Binary file not shown.
|
|
@ -149,12 +149,11 @@ class MetadataUpdateWorker(QThread):
|
||||||
if self.artist_has_valid_photo(artist):
|
if self.artist_has_valid_photo(artist):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Get the largest image from Spotify
|
# Get the image URL from Spotify
|
||||||
if not spotify_artist.get('images'):
|
if not spotify_artist.image_url:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
largest_image = max(spotify_artist['images'], key=lambda x: x['width'] * x['height'])
|
image_url = spotify_artist.image_url
|
||||||
image_url = largest_image['url']
|
|
||||||
|
|
||||||
# Download and validate image
|
# Download and validate image
|
||||||
response = requests.get(image_url, timeout=10)
|
response = requests.get(image_url, timeout=10)
|
||||||
|
|
@ -180,7 +179,7 @@ class MetadataUpdateWorker(QThread):
|
||||||
for genre in (artist.genres or []))
|
for genre in (artist.genres or []))
|
||||||
|
|
||||||
# Get Spotify artist genres
|
# Get Spotify artist genres
|
||||||
spotify_genres = set(spotify_artist.get('genres', []))
|
spotify_genres = set(spotify_artist.genres or [])
|
||||||
|
|
||||||
# Get genres from all albums
|
# Get genres from all albums
|
||||||
album_genres = set()
|
album_genres = set()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue