aboutsummaryrefslogtreecommitdiff
path: root/backend.py
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-06 11:26:45 +1300
committerArslaan Pathan <[email protected]>2026-10-06 11:26:45 +1300
commit2799880278cbd24210d4c869baf5f9c4f737196d (patch)
treec569ea34ad5f1abfd2e7965c75f6dd34bab5583d /backend.py
parent47d23851bea97603a171d821266b197566cb9acd (diff)
downloadremote-automation-2799880278cbd24210d4c869baf5f9c4f737196d.tar.xz
remote-automation-2799880278cbd24210d4c869baf5f9c4f737196d.zip
stop before fav
Diffstat (limited to 'backend.py')
-rw-r--r--backend.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/backend.py b/backend.py
index c4eac01..91bb917 100644
--- a/backend.py
+++ b/backend.py
@@ -145,6 +145,10 @@ def voldown():
@app.get("/automate/music/fav")
def fav_song():
global music_process
+ if music_process and music_process.poll() is None:
+ music_process.terminate()
+ music_process = None
+
music_process = subprocess.Popen([
"mpv",
"--no-video",