Sometimes lastfm doesn't give us a list of tracks (lastfm.py)

This commit is contained in:
jesopo 2019-02-18 13:19:45 +00:00
parent 6da35a899b
commit cae6d970ca

View file

@ -31,7 +31,10 @@ class Module(ModuleManager.BaseModule):
if page:
if "recenttracks" in page.data and len(page.data["recenttracks"
]["track"]):
now_playing = page.data["recenttracks"]["track"][0]
now_playing = page.data["recenttracks"]["track"]
if type(now_playing) == list:
now_playing = now_playing[0]
track_name = now_playing["name"]
artist = now_playing["artist"]["#text"]