diff --git a/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json b/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json index 9963eea..912ee6c 100644 --- a/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json +++ b/.nicegui/storage-user-83ffc178-0f94-4ada-8ca6-1c51b99b4b9c.json @@ -1 +1 @@ -{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":2,"display_name":"Daniel Nagel","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"} \ No newline at end of file +{"authenticated":true,"discord_id":"277898241750859776","discord_name":"mrteels","db_id":1,"display_name":"Daniel N.","discord_avatar_url":"https://cdn.discordapp.com/avatars/277898241750859776/7c3446bb51fafd72b1b4c21124b4994f.png"} \ No newline at end of file diff --git a/data/setup_database.py b/data/setup_database.py index c551ad5..b42f6ec 100644 --- a/data/setup_database.py +++ b/data/setup_database.py @@ -30,6 +30,7 @@ def init_db(): name TEXT NOT NULL, picture TEXT, description TEXT, + active_players INTEGER DEFAULT 0, min_score INTEGER DEFAULT 0, max_score INTEGER DEFAULT 100 ) @@ -61,8 +62,8 @@ def init_db(): player2_id INTEGER, score_player2 INTEGER, played_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - mmr_change_winner INTEGER, - mmr_change_looser INTEGER, + player1_mmr_change INTEGER, + player2_mmr_change INTEGER, FOREIGN KEY (gamesystem_id) REFERENCES gamesystems (id), FOREIGN KEY (player1_id) REFERENCES players (id), FOREIGN KEY (player2_id) REFERENCES players (id) @@ -108,9 +109,9 @@ def seed_gamesystems(): connection = sqlite3.connect(DB_PATH) cursor = connection.cursor() systems = [ - ("Warhammer 40k","/gui/pictures/wsdg.png","Die Schlacht um die Galaxie in einer entfernten Zukunft." , 0, 100), - ("Warhammer Age of Sigmar","/gui/pictures/wsdg.png","" , 0, 50), - ("Spearhead","/gui/pictures/wsdg.png","" , 0, 50) + ("Warhammer 40k", "/gui/pictures/wsdg.png", "Die Schlacht um die Galaxie in einer entfernten Zukunft.", 0, 100), + ("Warhammer Age of Sigmar", "/gui/pictures/wsdg.png", "Der ewige Krieg um die Reiche der Sterblichen in einer epischen Fantasy-Welt.", 0, 50), + ("Spearhead", "/gui/pictures/wsdg.png", "Schnelle und taktische Scharmützel für actiongeladene Kämpfe.", 0, 50) ] # executemany ist eine extrem schnelle SQL For-Schleife für Inserts diff --git a/gui/match_gui.py b/gui/match_gui.py index 78cc17c..b99aec6 100644 --- a/gui/match_gui.py +++ b/gui/match_gui.py @@ -74,5 +74,5 @@ def setup_routes(): # Buttons ganz unten in einer Reihe with ui.row().classes("w-full items-center justify-between mt-8"): - ui.button('Cancel', on_click=lambda: ui.navigate.to('/statistic/{systemname}')).classes('bg-gray-500 text-white') + ui.button('Cancel', on_click=lambda: ui.navigate.to(f'/statistic/{systemname}')).classes('bg-gray-500 text-white') ui.button(text="Absenden", color="positive", on_click=lambda: input_match_to_database())