Sometimes lastfm doesn't give us a list of tracks (lastfm.py)
This commit is contained in:
parent
6da35a899b
commit
cae6d970ca
1 changed files with 4 additions and 1 deletions
|
@ -31,7 +31,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
if page:
|
if page:
|
||||||
if "recenttracks" in page.data and len(page.data["recenttracks"
|
if "recenttracks" in page.data and len(page.data["recenttracks"
|
||||||
]["track"]):
|
]["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"]
|
track_name = now_playing["name"]
|
||||||
artist = now_playing["artist"]["#text"]
|
artist = now_playing["artist"]["#text"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue