fix: impose file path check for launch_music and resume, fixed #77

This commit is contained in:
Terry Geng
2020-02-26 16:57:56 +08:00
parent 78b11d1fb5
commit 9ce98196a1
4 changed files with 59 additions and 30 deletions

View File

@ -257,7 +257,9 @@ def cmd_play_url(bot, user, text, command, parameter):
music['ready'] = "no"
var.playlist.append(music)
logging.info("cmd: add to playlist: " + music['url'])
bot.async_download_next()
if var.playlist.length() == 2:
# If I am the second item on the playlist. (I am the next one!)
bot.async_download_next()
else:
bot.send_msg(constants.strings('unable_download'), text)
@ -514,7 +516,8 @@ def cmd_current_music(bot, user, text, command, parameter):
def cmd_skip(bot, user, text, command, parameter):
if bot.next(): # Is no number send, just skip the current music
if var.playlist.length() > 0:
bot.stop()
bot.launch_music()
bot.async_download_next()
else: