Skip to content

Commit

Permalink
API now properly serves server and optional builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkuip committed Sep 2, 2024
1 parent 1f6c716 commit fa0c563
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ def modpack_slug(slug: str):
return jsonify({"error": "Modpack does not exist/Build does not exist"}), 404


@api.route("/api/modpack/<slug>/<build>")
@api.route("/api/modpack/<slugstring>/<buildstring>")
def modpack_slug_build(slugstring: str, buildstring: str):
modpack = Modpack.get_by_cid_slug(request.args.get("cid"), slugstring)
if not modpack:
return jsonify({"error": "Modpack does not exist/Build does not exist"}), 404

buildsplit = buildstring.split("-")
buildsplit += ""
buildsplit.append("")
print(buildsplit)
buildnumber = buildsplit[0]
buildtag = buildsplit[1]
build = modpack.get_build(buildnumber)
Expand Down

0 comments on commit fa0c563

Please sign in to comment.