aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-06 12:59:34 +1300
committerArslaan Pathan <[email protected]>2026-10-06 12:59:34 +1300
commit36e061f9db1a7b99c19bcebd960e47c42616e6c3 (patch)
tree58390e96debfaef762342e2c3ac2fd735d33661b
parent90bde93d0462bb943cd100bfd87781e4232d1b82 (diff)
downloadremote-automation-36e061f9db1a7b99c19bcebd960e47c42616e6c3.tar.xz
remote-automation-36e061f9db1a7b99c19bcebd960e47c42616e6c3.zip
terminate before music() on next
-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")