From 659fab48b4c82b626a32e3e67508a96838845f0b Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sat, 7 Mar 2020 15:22:50 +0800 Subject: [PATCH] feat: add automode into the webinterface #91 --- interface.py | 4 ++++ templates/index.html | 34 ++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/interface.py b/interface.py index 36b811c..bbda09d 100644 --- a/interface.py +++ b/interface.py @@ -268,6 +268,10 @@ def post(): var.playlist = media.playlist.get_playlist("repeat", var.playlist) var.db.set('playlist', 'playback_mode', "repeat") log.info("web: playback mode changed to repeat.") + if action == "autoplay": + var.playlist = media.playlist.get_playlist("autoplay", var.playlist) + var.db.set('playlist', 'playback_mode', "autoplay") + log.info("web: playback mode changed to autoplay.") elif action == "stop": var.bot.stop() elif action == "pause": diff --git a/templates/index.html b/templates/index.html index d010a36..d2f7d28 100644 --- a/templates/index.html +++ b/templates/index.html @@ -138,23 +138,29 @@
+ +