This commit is contained in:
		@@ -37,9 +37,12 @@ class ItemApi(SpotifyUserStoreResource):
 | 
			
		||||
            if 'artist-credit' in currrelease['release'] and currrelease['release']['artist-credit']:
 | 
			
		||||
                retdata['artist'] = currrelease['artist-credit'][0]['artist']['name']
 | 
			
		||||
            album_spot = \
 | 
			
		||||
                self.spotify.search(q=f"{retdata.get('artist', '')} {retdata['title']}", limit=1)[
 | 
			
		||||
                    'albums'][
 | 
			
		||||
                    'items']
 | 
			
		||||
                self.spotify.search(q=f"{retdata.get('artist', '')} {retdata['title']}", limit=1).get(
 | 
			
		||||
                    'albums')
 | 
			
		||||
            if album_spot:
 | 
			
		||||
                album_spot = album_spot['items']
 | 
			
		||||
                if len(album_spot) > 0:
 | 
			
		||||
                    retdata['spotify_id'] = f"spotify:album:{album_spot[0]['id']}"
 | 
			
		||||
            try:
 | 
			
		||||
                imgurl = musicbrainzngs.get_image_list(currrelease['id'])['images']
 | 
			
		||||
                if len(imgurl) > 0:
 | 
			
		||||
@@ -65,7 +68,7 @@ class ItemApi(SpotifyUserStoreResource):
 | 
			
		||||
            retdata = {"id": itemid, "title": currwork['title']}
 | 
			
		||||
            if len(work_spot) > 0:
 | 
			
		||||
                retdata['spotify_id'] = f"spotify:track:{work_spot[0]['id']}"
 | 
			
		||||
                work_image = work_spot[0]['images']
 | 
			
		||||
                work_image = work_spot[0]['album']['images']
 | 
			
		||||
                if len(work_image) > 0:
 | 
			
		||||
                    retdata['cover_url'] = work_image[0]['url']
 | 
			
		||||
                    retdata['cover_url_small'] = work_image[len(work_image) - 1]['url']
 | 
			
		||||
 
 | 
			
		||||
@@ -43,8 +43,10 @@ class SingleListApi(SpotifyUserStoreResource):
 | 
			
		||||
                    currartist = currrelease['release']['artist-credit'][0]['artist']
 | 
			
		||||
                    releasedata['artist'] = currartist['name']
 | 
			
		||||
                album_spot = \
 | 
			
		||||
                    self.spotify.search(q=f"{releasedata.get('artist', '')} {release['title']}", limit=1)[
 | 
			
		||||
                        'albums']['items']
 | 
			
		||||
                    self.spotify.search(q=f"{releasedata.get('artist', '')} {release['title']}", limit=1).get(
 | 
			
		||||
                        'albums')
 | 
			
		||||
                if album_spot:
 | 
			
		||||
                    album_spot = album_spot['items']
 | 
			
		||||
                    if len(album_spot) > 0:
 | 
			
		||||
                        releasedata['spotify_id'] = f"spotify:album:{album_spot[0]['id']}"
 | 
			
		||||
                try:
 | 
			
		||||
@@ -80,7 +82,7 @@ class SingleListApi(SpotifyUserStoreResource):
 | 
			
		||||
                work_spot = self.spotify.search(q=work['title'], type="track", limit=1)['tracks']['items']
 | 
			
		||||
                if len(work_spot) > 0:
 | 
			
		||||
                    workdata['spotify_id'] = f"spotify:track:{work_spot[0]['id']}"
 | 
			
		||||
                    work_image = work_spot[0]['images']
 | 
			
		||||
                    work_image = work_spot[0]['album']['images']
 | 
			
		||||
                    if len(work_image) > 0:
 | 
			
		||||
                        workdata['cover_url'] = work_image[0]['url']
 | 
			
		||||
                        workdata['cover_url_small'] = work_image[len(work_image) - 1]['url']
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user