feat: remove item once played in one-shot mode. make it as close to the old version as possible, #79

This commit is contained in:
Terry Geng
2020-02-27 00:59:09 +08:00
parent 45f6923534
commit a03f82d90a
3 changed files with 8 additions and 4 deletions

View File

@ -59,7 +59,11 @@ class PlayList(list):
logging.debug("playlist: Next into the queue")
if self.current_index < len(self) - 1:
self.current_index += 1
if self.mode == "one-shot":
super().__delitem__(self.current_index)
else:
self.current_index += 1
return self[self.current_index]
else:
self.current_index = 0