From 5797ba71c1cdd76f15d3a7810e456a85ff9bbf7d Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sun, 22 Dec 2024 23:53:25 +0100 Subject: [PATCH] fix missing row in result for optional/server builds --- models/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/build.py b/models/build.py index 155fa64..36602bf 100644 --- a/models/build.py +++ b/models/build.py @@ -179,14 +179,14 @@ def get_modversions_api(self, tag: str): cursor = conn.cursor(dictionary=True) if tag == "optional": cursor.execute( - """SELECT modversions.id, modversions.mod_id, modversions.version, modversions.mcversion, modversions.md5, modversions.created_at, modversions.updated_at, modversions.filesize, mods.name AS modname, mods.pretty_name, mods.author, mods.link, build_modversion.optional + """SELECT modversions.id, modversions.mod_id, modversions.version, modversions.mcversion, modversions.md5, modversions.created_at, modversions.updated_at, modversions.filesize, mods.name AS modname, mods.pretty_name, mods.author, mods.link, mods.description, build_modversion.optional FROM modversions INNER JOIN build_modversion ON modversions.id = build_modversion.modversion_id JOIN mods ON modversions.mod_id = mods.id WHERE build_modversion.build_id = %s AND mods.side IN ('CLIENT','BOTH') """, (self.id,)) elif tag == "server": cursor.execute( - """SELECT modversions.id, modversions.mod_id, modversions.version, modversions.mcversion, modversions.md5, modversions.created_at, modversions.updated_at, modversions.filesize, mods.name AS modname, mods.pretty_name, mods.author, mods.link, build_modversion.optional + """SELECT modversions.id, modversions.mod_id, modversions.version, modversions.mcversion, modversions.md5, modversions.created_at, modversions.updated_at, modversions.filesize, mods.name AS modname, mods.pretty_name, mods.author, mods.link, mods.description, build_modversion.optional FROM modversions INNER JOIN build_modversion ON modversions.id = build_modversion.modversion_id JOIN mods ON modversions.mod_id = mods.id WHERE build_modversion.build_id = %s AND build_modversion.optional = 0 AND mods.side IN ('SERVER','BOTH')