]> git.0d.be Git - botaradio.git/commitdiff
fix: 'jump' doesn't play the music if paused.
authorTerry Geng <gengyanda@gmail.com>
Sat, 14 Mar 2020 04:07:41 +0000 (12:07 +0800)
committerTerry Geng <gengyanda@gmail.com>
Sat, 14 Mar 2020 08:34:04 +0000 (16:34 +0800)
command.py
interface.py

index 5022088999d6f1dacbfd670365f2520836f33120..7e42533164eef9693f2d636db1f614519b52815d 100644 (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)
 
index c2a1d3dacd16c54c585d2b13807a7999d7ad7130..70b95efd9d0fc6d12ce93bb60ff51b0690f4cc3e 100644 (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']: