From fce5e5d830ad94679a471fd007418898ed67d1b8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 11 May 2018 22:07:28 +0300 Subject: [PATCH] 'Tracks' with only one are artists not tracks, skip them --- pylast/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index bb8a34a..35cffaf 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -2202,8 +2202,11 @@ class User(_BaseObject, _Chartable): self.ws_prefix + ".getLovedTracks", cacheable, params): + try: + artist = _extract(track, "name", 1) + except IndexError: + continue title = _extract(track, "name") - artist = _extract(track, "name", 1) date = _extract(track, "date") timestamp = track.getElementsByTagName( "date")[0].getAttribute("uts")