diff --git a/ui-templates/restart-confirm.html b/ui-templates/restart-confirm.html new file mode 100644 index 0000000..3f7b3c6 --- /dev/null +++ b/ui-templates/restart-confirm.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% block content_inner %} +
+

Hang on a second!

+

Something is currently playing. Restarting will interrupt it! Are you sure?

+ Cancel + Confirm +
+{% endblock %} diff --git a/web_server.py b/web_server.py index 142db8a..04ed686 100644 --- a/web_server.py +++ b/web_server.py @@ -496,6 +496,11 @@ def quit(request): @app.route("/restart") def restart(request): + if request.args.get("confirm", '') != "true": + for i in range(server_state.get()["num_channels"]): + state = status(i) + if state["playing"]: + return render_template("restart-confirm.html", data=None) server_state.update("running_state", "restarting") data = {