diff --git a/script.audio.motherearth/motherearth.py b/script.audio.motherearth/motherearth.py index c3002e54f..4da90315a 100644 --- a/script.audio.motherearth/motherearth.py +++ b/script.audio.motherearth/motherearth.py @@ -5,7 +5,6 @@ KEY_FILTER_RE = re.compile(r'[^\w\']+') NOWPLAYING_URL = 'https://motherearth.streamserver24.com/api/nowplaying/{}' -FANART_URL = 'https://motherearthradio.de/artist/{}/fanart.jpg' STREAMS = [ { @@ -80,7 +79,7 @@ def update(self): data = response.json() current = None songs = {} - key = build_key((data['now_playing']['song']['artist'], data['now_playing']['song']['title'])) + key = build_key((data['now_playing']['song']['artist'], data['now_playing']['song']['title'])) songs[key] = { 'artist': data['now_playing']['song']['artist'], 'cover': data['now_playing']['song']['art'], @@ -89,6 +88,7 @@ def update(self): 'album': data['now_playing']['song']['album'], } current = songs[key] + self._current = current self.songs = songs self.next_update = now + data['now_playing']['remaining'] diff --git a/script.audio.motherearth/service.py b/script.audio.motherearth/service.py index c04d3c5c2..797d4b322 100644 --- a/script.audio.motherearth/service.py +++ b/script.audio.motherearth/service.py @@ -3,13 +3,14 @@ import xbmc import xbmcaddon import xbmcgui +import urllib from collections import namedtuple -from motherearth import STREAM_INFO, NowPlaying, FANART_URL - +from motherearth import STREAM_INFO, NowPlaying RESTART_INTERVAL = 1.0 RESTART_TIMEOUT = 1.0 +FANART_URL = "https://motherearthradio.de/artist/{}/fanart.jpg" Song = namedtuple('Song', 'data cover') @@ -86,8 +87,9 @@ def update_player(self): item = xbmcgui.ListItem() item.setPath(self.getPlayingFile()) item.setArt({'thumb': song.cover}) - # item.setArt({'fanart': song.cover}) - item.setArt({'fanart' : FANART_URL.format((song.data['artist']))}) + fanart = urllib.parse.quote(song.data['artist']) + fanart = FANART_URL.format(fanart) + item.setArt({'fanart' : fanart}) item.setInfo('music', info) self.updateInfoTag(item)