Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • kodi/script.spotify.screensaver
1 result
Show changes
Commits on Source (2)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.spotify.screensaver"
name="Spotify Screensaver"
version="0.0.6"
version="0.0.7"
provider-name="Benoît Harrault">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
......
......@@ -153,16 +153,21 @@ class GUI(xbmcgui.WindowXMLDialog):
)
data = response.json()
track_name = data['name']
track_name = data.get('name', '')
# album/track image
album = data['album']
images = album['images']
image_url = images[0]['url']
imageLST.append(
xbmcgui.ListItem(track_name, thumbnailImage=image_url)
)
album = data.get('album')
if album is not None:
images = album.get('images')
if images is not None:
image = images[0]
if image is not None:
image_url = image.get('url')
if image_url is not None:
imageLST.append(
xbmcgui.ListItem(
track_name, thumbnailImage=image_url)
)
except Exception as e:
self.log('failed to get track data ' + str(e), xbmc.LOGERROR)
......