From 3002e8fd02798a9b03afb61312a5df315fccb129 Mon Sep 17 00:00:00 2001 From: Troy Olson Date: Thu, 15 Dec 2016 11:31:11 -0800 Subject: [PATCH] Fix for last.FM images Cover art images cached from Last.FM are too small. This ensures that the large sized image is used. Simply need to change to use the second to last URL in the Last.FM image array, instead of the last one (as is currently being done). --- headphones/cache.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headphones/cache.py b/headphones/cache.py index 202b7802d..f41ebcc80 100644 --- a/headphones/cache.py +++ b/headphones/cache.py @@ -217,7 +217,7 @@ def get_image_links(self, ArtistID=None, AlbumID=None): return try: - image_url = data['artist']['image'][-1]['#text'] + image_url = data['artist']['image'][-2]['#text'] except (KeyError, IndexError): logger.debug('No artist image found') image_url = None @@ -235,7 +235,7 @@ def get_image_links(self, ArtistID=None, AlbumID=None): return try: - image_url = data['album']['image'][-1]['#text'] + image_url = data['album']['image'][-2]['#text'] except (KeyError, IndexError): logger.debug('No album image found on last.fm') image_url = None @@ -304,7 +304,7 @@ def _update_cache(self): logger.debug('No artist bio found') self.info_content = None try: - image_url = data['artist']['image'][-1]['#text'] + image_url = data['artist']['image'][-2]['#text'] except KeyError: logger.debug('No artist image found') image_url = None @@ -342,7 +342,7 @@ def _update_cache(self): logger.debug('No album infomation found') self.info_content = None try: - image_url = data['album']['image'][-1]['#text'] + image_url = data['album']['image'][-2]['#text'] except KeyError: logger.debug('No album image link found') image_url = None