]> git.0d.be Git - botaradio.git/commitdiff
fix: one-shot crash bot, #79
authorTerry Geng <gengyanda@gmail.com>
Thu, 27 Feb 2020 00:19:31 +0000 (08:19 +0800)
committerTerry Geng <gengyanda@gmail.com>
Thu, 27 Feb 2020 00:20:26 +0000 (08:20 +0800)
media/playlist.py

index caf931b75a43bbcb944601e38b6a5b562425e65f..7074e555d0f139e69eae529a66c80bc07b17cff0 100644 (file)
@@ -59,7 +59,7 @@ class PlayList(list):
         logging.debug("playlist: Next into the queue")
 
         if self.current_index < len(self) - 1:
-            if self.mode == "one-shot":
+            if self.mode == "one-shot" and self.current_index != -1:
                 super().__delitem__(self.current_index)
             else:
                 self.current_index += 1