Commit 43f1cf21 authored by fred's avatar fred

stamina: abort only when recent tracks has been emptied out

parent 8d5b96a0
......@@ -219,9 +219,9 @@ class Tracklist:
tracks = tracks.filter(**extra_filters)
tracks = tracks.exclude(id__in=self.get_recent_track_ids()).order_by('?')[:k*10]
if len(tracks) == 0:
self.recent_tracks_id = self.recent_tracks_id[:len(self.recent_tracks_id) // 2]
if len(self.recent_tracks_id) == 0:
break
self.recent_tracks_id = self.recent_tracks_id[:len(self.recent_tracks_id) // 2]
continue
def compute_weight(track):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment