tim-we/py-radio

Double clip avoidance not working

Opened this issue · 1 comments

image

Either

py-radio/radio/library.py

Lines 92 to 105 in 133cc3b

def next(self) -> str:
assert not self.empty(), "Cannot pick clip from empty pool"
# find a clip that is not in the recent history
idx = random.randrange(0, len(self.clips))
while idx in self._history:
idx = random.randrange(0, len(self.clips))
# add to recent history
self._history.append(idx)
if len(self._history) > self._history_len:
del self._history[0]
return self.clips[idx]
is not working or _history_len has an incorrect value.

More likely: might be caused by a library update
TODO: keep history