aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend.py b/backend.py
index 35cc6b1..2def49c 100644
--- a/backend.py
+++ b/backend.py
@@ -133,6 +133,12 @@ def music():
@app.get("/automate/music/next")
def music_next():
+ global music_process
+
+ if music_process and music_process.poll() is None:
+ music_process.terminate()
+ music_process = None
+
return music()
@app.get("/automate/music/stop")