fix: 'jump' doesn't play the music if paused.

This commit is contained in:
Terry Geng 2020-03-14 12:07:41 +08:00
parent ec28902f66
commit 457f1c691f
2 changed files with 8 additions and 2 deletions

View File

@ -176,7 +176,10 @@ def cmd_play(bot, user, text, command, parameter):
# the one you want
var.playlist.point_to(int(parameter) - 1 - 1)
bot.interrupt()
if not bot.is_pause:
bot.interrupt()
else:
bot.is_pause = False
else:
bot.send_msg(constants.strings('invalid_index', index=parameter), text)

View File

@ -292,7 +292,10 @@ def post():
if len(var.playlist) >= int(request.form['play_music']):
var.playlist.point_to(int(request.form['play_music']) - 1)
var.bot.interrupt()
if not var.bot.is_pause:
var.bot.interrupt()
else:
var.bot.is_pause = False
time.sleep(0.1)
elif 'delete_music_file' in request.form and ".." not in request.form['delete_music_file']: