feat: Add initial spotify restart app
All checks were successful
Build Docker / BuildImage (push) Successful in 2m10s

This commit is contained in:
2025-07-08 22:49:53 +10:00
parent 9cf1ff4126
commit 43c0f83b57
3 changed files with 37 additions and 43 deletions

View File

@@ -74,9 +74,24 @@ def wellknown(path):
# region Main routes
@app.route("/")
def index():
# Get current time in the format "dd MMM YYYY hh:mm AM/PM"
current_datetime = datetime.now().strftime("%d %b %Y %I:%M %p")
return render_template("index.html", datetime=current_datetime)
return render_template("index.html")
@app.route("/restart")
def restart():
"""
Restart the server by redirecting to the same URL.
This is a simple way to restart the server without needing to stop it manually.
"""
# Execute a `pkill spotifyd` command to stop the spotifyd process
status = os.system("pkill spotifyd")
# Start with a new process
os.system("spotifyd -d 'Family Room'")
return redirect('/')
@app.route("/<path:path>")