Now playing shouldn't count as a recently played track

This commit is contained in:
kvanzuijlen 2020-07-12 12:21:40 +02:00 committed by Koen van Zuijlen
parent 92004058ba
commit 11d955dd89

View file

@ -2385,6 +2385,7 @@ class User(_BaseObject, _Chartable):
if time_to:
params["to"] = time_to
track_count = 0
for track_node in _collect_nodes(
limit + 1 if limit else None,
self,
@ -2396,7 +2397,10 @@ class User(_BaseObject, _Chartable):
if track_node.hasAttribute("nowplaying"):
continue # to prevent the now playing track from sneaking in
if limit and track_count >= limit:
break
yield self._extract_played_track(track_node=track_node)
track_count += 1
return _get_recent_tracks() if stream else list(_get_recent_tracks())