From 457f1c691fb6240d357d5e21aed1cb4c8688be61 Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sat, 14 Mar 2020 12:07:41 +0800 Subject: [PATCH] fix: 'jump' doesn't play the music if paused. --- command.py | 5 ++++- interface.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/command.py b/command.py index 5022088..7e42533 100644 --- a/command.py +++ b/command.py @@ -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) diff --git a/interface.py b/interface.py index c2a1d3d..70b95ef 100644 --- a/interface.py +++ b/interface.py @@ -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']: