Fix getting now playing for user with no scrobbles. Closes #81.
This commit is contained in:
parent
f59d2cc680
commit
16079468ab
2 changed files with 18 additions and 3 deletions
|
@ -3002,7 +3002,12 @@ class User(_BaseObject):
|
|||
|
||||
doc = self._request('user.getRecentTracks', False, params)
|
||||
|
||||
e = doc.getElementsByTagName('track')[0]
|
||||
tracks = doc.getElementsByTagName('track')
|
||||
|
||||
if len(tracks) == 0:
|
||||
return None
|
||||
|
||||
e = tracks[0]
|
||||
|
||||
if not e.hasAttribute('nowplaying'):
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue