diff --git a/Config/party.sql b/Config/party.sql index e10522f..7a39f20 100644 --- a/Config/party.sql +++ b/Config/party.sql @@ -12,3 +12,4 @@ CREATE TABLE IF NOT EXISTS spiel (spielname TEXT, Genre TEXT, Erscheinungsjahr T CREATE TABLE IF NOT EXISTS dateien (dateiID INTEGER PRIMARY KEY NOT NULL, dateiname TEXT, sessionID INTEGER); CREATE TABLE IF NOT EXISTS 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 IF NOT EXISTS queue (songID INTEGER, sessionID INTEGER) +CREATE TABLE IF NOT EXISTS messages (username TEXT, message TEXT, timestamp TEXT) 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 @@