From 73554214f75769ec37c52ad29f54d07159f7d4bd Mon Sep 17 00:00:00 2001 From: xeals Date: Mon, 27 Mar 2023 20:17:18 +1100 Subject: [PATCH] add metadata for external usage --- main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 5cb27d8..725947b 100755 --- a/main.py +++ b/main.py @@ -51,7 +51,7 @@ def _init_db(conn: sqlite3.Connection): ); CREATE TABLE IF NOT EXISTS nicknames( game, player, name, specie, - UNIQUE(game,player, specie) + UNIQUE(game, player, specie) ); """ ) @@ -296,6 +296,15 @@ def main(): error(f"bad replay {r}") continue + db.execute( + """ + INSERT INTO games(id, p1, p2, format, uploadtime) + VALUES (?, ?, ?, ?, ?) + ON CONFLICT DO NOTHING + """, + (replay.id, replay.p1, replay.p2, replay.format, replay.uploadtime), + ) + parse_log(replay.id, replay.log, into=db) db.commit()