releases do not have title
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Torma Kristóf 2020-11-27 02:09:01 +01:00
parent 2b1650b36e
commit e81c50a4b1
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class APIInteractionResource(UserStoreResource):
else: else:
return spotify_uri, None, None return spotify_uri, None, None
def getcoverimage(self, releaseid: str, itemtype: str, title: str, artist: str, def getcoverimage(self, releaseid: str, itemtype: str, artist: str, title: str = "",
album: str = "") -> tuple: album: str = "") -> tuple:
if itemtype != "recording" and itemtype != "release": if itemtype != "recording" and itemtype != "release":
return None, None return None, None
@ -70,7 +70,7 @@ class APIInteractionResource(UserStoreResource):
if 'artist-credit' in currrelease and currrelease['artist-credit']: if 'artist-credit' in currrelease and currrelease['artist-credit']:
retdata['artist'] = currrelease['artist-credit'][0]['artist']['name'] retdata['artist'] = currrelease['artist-credit'][0]['artist']['name']
retdata['cover_url'], retdata['cover_url_small'] = self.getcoverimage( retdata['cover_url'], retdata['cover_url_small'] = self.getcoverimage(
itemid, 'release', title=retdata['title'], album=retdata.get('album'), itemid, 'release', album=retdata.get('album'),
artist=retdata.get('artist')) artist=retdata.get('artist'))
retdata['spotify_id'], _, _ = \ retdata['spotify_id'], _, _ = \
self.queryspotifyinfo('release', title=retdata['title']) self.queryspotifyinfo('release', title=retdata['title'])