From 12829d91292f6eeefbbbf19e1a76b173c65c12da Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sun, 26 May 2024 02:32:44 +0200 Subject: [PATCH 1/3] remove uneeded mysql code --- models/modversion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/modversion.py b/models/modversion.py index a323a64..bb9b4d7 100644 --- a/models/modversion.py +++ b/models/modversion.py @@ -44,7 +44,7 @@ def add_modversion_to_selected_build(cls, modver_id, mod_id, build_id, marked, o conn.commit() # when new modversion is added to build, old modversion gets deleted, quite tricky as both values are unique each time and you need to get all modversion and delete them on said build. cur.execute( - """SELECT build_modversion.id, modversions.id AS modverid, modversions.mod_id AS modid + """SELECT build_modversion.id FROM build_modversion INNER JOIN modversions ON build_modversion.modversion_id = modversions.id WHERE build_id = %s AND modversions.mod_id = %s @@ -55,7 +55,7 @@ def add_modversion_to_selected_build(cls, modver_id, mod_id, build_id, marked, o except: build_modid = None if build_modid is not None: - cur.execute("UPDATE build_modversion SET modversion_id = %s WHERE id = %s AND build_id = %s", (modver_id, build_modid, build_id)) + cur.execute("UPDATE build_modversion SET modversion_id = %s WHERE id = %s", (modver_id, build_modid)) conn.commit() return None cur.execute("SELECT * FROM modversions WHERE mod_id = %s", (mod_id,)) From 9f9f3cc9329463f29d39894d896791b744bd6679 Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sun, 26 May 2024 14:16:51 +0200 Subject: [PATCH 2/3] fix api for modversion not working --- models/mod.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/mod.py b/models/mod.py index fc3a0b5..f7fd570 100644 --- a/models/mod.py +++ b/models/mod.py @@ -127,7 +127,7 @@ def get_version(self, version): cur.execute("SELECT * FROM modversions WHERE mod_id = %s AND version = %s", (self.id, version)) row = cur.fetchone() if row: - return Modversion(row["id"], row["mod_id"], row["version"], row["md5"], row["created_at"], row["updated_at"], row["filesize"]) + return Modversion(row["id"], row["mod_id"], row["version"], row["mcversion"], row["md5"], row["created_at"], row["updated_at"], row["filesize"]) return None def to_json(self): From e382fd1cdbab3a064951bde009f9bc8ff5084ba5 Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sun, 26 May 2024 14:21:33 +0200 Subject: [PATCH 3/3] bump version --- app.py | 2 +- templates/layout.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 5579282..072cf39 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -__version__ = "1.1.1" +__version__ = "1.1.2" import os from dotenv import load_dotenv diff --git a/templates/layout.html b/templates/layout.html index 4812a28..2fbd3bc 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -74,7 +74,7 @@
Version 1.1.1
+Version 1.1.2