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