feat: add 'clear_when_stop_in_oneshot' option in config for azlux

This commit is contained in:
Terry Geng
2020-03-20 10:49:44 +08:00
parent 4e287d6b1b
commit 1d1ff50a59
4 changed files with 13 additions and 2 deletions

View File

@@ -334,7 +334,11 @@ def post():
var.cache.build_dir_cache(var.bot)
log.info("web: Local file cache refreshed.")
elif action == "stop":
var.bot.stop()
if var.config.getboolean("bot", "clear_when_stop_in_oneshot", fallback=False) \
and var.playlist.mode == 'one-shot':
var.bot.clear()
else:
var.bot.stop()
elif action == "pause":
var.bot.pause()
elif action == "resume":