Merge pull request #268 from pylast/skip-artist-in-tracks

'Tracks' with only one <name> are artists not tracks, skip them
This commit is contained in:
Hugo 2018-05-16 12:03:18 +03:00 committed by GitHub
commit 2194245e75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2202,8 +2202,11 @@ class User(_BaseObject, _Chartable):
self.ws_prefix + ".getLovedTracks", self.ws_prefix + ".getLovedTracks",
cacheable, cacheable,
params): params):
try:
artist = _extract(track, "name", 1)
except IndexError: # pragma: no cover
continue
title = _extract(track, "name") title = _extract(track, "name")
artist = _extract(track, "name", 1)
date = _extract(track, "date") date = _extract(track, "date")
timestamp = track.getElementsByTagName( timestamp = track.getElementsByTagName(
"date")[0].getAttribute("uts") "date")[0].getAttribute("uts")