diff --git a/libsaria/collection/lens.py b/libsaria/collection/lens.py index cd7fa6c0..dbeb9682 100644 --- a/libsaria/collection/lens.py +++ b/libsaria/collection/lens.py @@ -123,13 +123,17 @@ class Playlist(collection.Collection): def get_rand_candidate(self): num = self.num_visible() next_idx = rand.randint(0, num-1) - func = self.visible + func = self.walk_filtered_ids if self.filtered == False: func = self.walk_ids for n in func(): if next_idx == 0: return n next_idx -= 1 + # We shouldn't ever get here, but for some reason we are. + # We return the last value of n, but I would like to figure + # Out why we leave the loop early eventually. + return n