diff --git a/server.py b/server.py index d413b84..4ecb075 100644 --- a/server.py +++ b/server.py @@ -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("/") diff --git a/templates/assets/css/index.css b/templates/assets/css/index.css index 3ef53b7..4aa9f31 100644 --- a/templates/assets/css/index.css +++ b/templates/assets/css/index.css @@ -38,4 +38,20 @@ a:hover { .mike-section p { line-height: 1.6; margin-bottom: 15px; +} + +.button { + display: inline-block; + padding: 10px 20px; + background-color: #ffffff; + color: #000000; + border-radius: 5px; + text-decoration: none; + transition: background-color 0.3s ease; + border: 1px solid #ffffff; +} +.button:hover { + background-color: #000000; + color: #ffffff; + border: 1px solid #ffffff; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index f3aac2c..1ce436d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,49 +12,12 @@
-

Nathan.Woodburn/

- The current date and time is {{datetime}} +

Spotify Player

+ Restart
-
-

Pulling data

- This is a test content area that will be updated with data from the server. -
-
- -
- - - + \ No newline at end of file