diff --git a/Config/party.sql b/Config/party.sql index 6ec2a00..cb391f3 100644 --- a/Config/party.sql +++ b/Config/party.sql @@ -11,4 +11,5 @@ CREATE TABLE mws (matekisten INTEGER, sessionID INTEGER NOT NULL); CREATE TABLE spiel (spielname TEXT, Genre TEXT, Erscheinungsjahr TEXT, Gruppe TEXT, Teil INTEGER, sessionID INTEGER NOT NULL, Bildname TEXT); CREATE TABLE dateien (dateiID INTEGER PRIMARY KEY NOT NULL, dateiname TEXT, sessionID INTEGER); CREATE TABLE musikMetaDaten (songID INTEGER PRIMARY KEY Not NULL, artist TEXT, band TEXT, album TEXT, title TEXT, track TEXT, genre TEXT, composer TEXT, copyright TEXT, comment TEXT, releasedate TEXT, mp3_url TEXT, sessionID INTEGER, bildname TEXT); -CREATE TABLE queue (songID INTEGER, sessionID INTEGER) \ No newline at end of file +CREATE TABLE queue (songID INTEGER, sessionID INTEGER) +CREATE TABLE messages (username TEXT, message TEXT, timestamp TEXT) \ No newline at end of file diff --git a/server.py b/server.py index 021a4f0..4802c52 100644 --- a/server.py +++ b/server.py @@ -688,6 +688,16 @@ def server(): log_server("called /chat") return render_template("chat.html") + @app.route("/music/") + def get_music(id): + conn = sqlite3.connect("music.db") + cursor = conn.cursor() + cursor.execute("SELECT * FROM music WHERE id=?", (id,)) + music = cursor.fetchone() + conn.close() + return send_file(music[1], attachment_filename=music[2], as_attachment=True) + + @app.errorhandler(404) def page_not_found(e): error_log("called non-existing page") diff --git a/static/css/style.css b/static/css/style.css index 150b4b3..7b7e8e7 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -216,4 +216,30 @@ a { .timestamp { font-size: 12px; color: gray; + } + + + #player { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + } + .controls { + display: flex; + justify-content: center; + align-items: center; + } + .controls button { + margin: 0 10px; + } + + #send { + width: 80px; + display: inline-block; + } + + #input { + width: calc(100% - 80px); + display: inline-block; } \ No newline at end of file diff --git a/templates/session.html b/templates/session.html index 8e44e2a..41ff871 100644 --- a/templates/session.html +++ b/templates/session.html @@ -216,6 +216,31 @@