fix: crash triggering by stop and play when playlist is empty, fixed #206.
This commit is contained in:
parent
141977759f
commit
fceb50e894
@ -647,13 +647,16 @@ class MumbleBot:
|
|||||||
# Kill the ffmpeg thread and empty the playlist
|
# Kill the ffmpeg thread and empty the playlist
|
||||||
self.interrupt()
|
self.interrupt()
|
||||||
var.playlist.clear()
|
var.playlist.clear()
|
||||||
|
self.wait_for_ready = False
|
||||||
self.log.info("bot: music stopped. playlist trashed.")
|
self.log.info("bot: music stopped. playlist trashed.")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.interrupt()
|
self.interrupt()
|
||||||
self.is_pause = True
|
self.is_pause = True
|
||||||
var.playlist.next()
|
if len(var.playlist) > 0:
|
||||||
self.wait_for_ready = True
|
self.wait_for_ready = True
|
||||||
|
else:
|
||||||
|
self.wait_for_ready = False
|
||||||
self.log.info("bot: music stopped.")
|
self.log.info("bot: music stopped.")
|
||||||
|
|
||||||
def interrupt(self):
|
def interrupt(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user