Skip to content

Commit

Permalink
Merge pull request #56 from Thorfusion/dev
Browse files Browse the repository at this point in the history
fix api for modversion not working
  • Loading branch information
maggi373 authored May 26, 2024
2 parents 145ef0e + e382fd1 commit ec1ea50
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.1.1"
__version__ = "1.1.2"

import os
from dotenv import load_dotenv
Expand Down
2 changes: 1 addition & 1 deletion models/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions models/modversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,))
Expand Down
2 changes: 1 addition & 1 deletion templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</ul>
</nav>
<div class="flex-column flex-shrink-0 p-3 text-white navcontainer2">
<p class="">Version 1.1.1</p>
<p class="">Version 1.1.2</p>
</div>

</div>
Expand Down

0 comments on commit ec1ea50

Please sign in to comment.