Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix api for modversion not working #56

Merged
merged 3 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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