diff options
| author | 2019-02-18 13:19:45 +0000 | |
|---|---|---|
| committer | 2019-02-18 13:22:12 +0000 | |
| commit | cae6d970cafcde637f883f0f042ee0518ec0c97b (patch) | |
| tree | 83137b1465e4f920a59bd0b015d8936bd8da8434 /modules/lastfm.py | |
| parent | don't pass around `has_arbitrary` - we don't need it. (diff) | |
| signature | ||
Sometimes lastfm doesn't give us a list of tracks (lastfm.py)
Diffstat (limited to 'modules/lastfm.py')
| -rw-r--r-- | modules/lastfm.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/lastfm.py b/modules/lastfm.py index 1198b6f5..7cf52832 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -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"] |
