mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 23:59:35 +05:00
fix: build issues
This commit is contained in:
parent
d2da453808
commit
237ce9879d
5 changed files with 15 additions and 7 deletions
|
@ -8,6 +8,7 @@ from io import BytesIO
|
|||
import base64
|
||||
import json
|
||||
|
||||
|
||||
@apiPack.route("/<id>", methods=["GET"])
|
||||
def getPack(id):
|
||||
if not os.path.exists(f"{PACKS_FOLDER}/{id}/packfile.json"):
|
||||
|
@ -21,12 +22,15 @@ def getPack(id):
|
|||
|
||||
return jsonify(pack)
|
||||
|
||||
|
||||
@apiPack.route("/<id>/image", methods=["GET"])
|
||||
def getPackImage(id):
|
||||
if not os.path.exists(f"{PACKS_FOLDER}/{id}/packicon.png"):
|
||||
return redirect(url_for("static", filename="defaulticon.png"))
|
||||
|
||||
return send_file(f"{PACKS_FOLDER}/{id}/packicon.png")
|
||||
with open(f"{PACKS_FOLDER}/{id}/packicon.png", mode="rb") as fp:
|
||||
f = BytesIO(fp.read())
|
||||
return send_file(f, mimetype="image/png")
|
||||
|
||||
|
||||
@apiPack.route("/<id>/image/edit", methods=["POST"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue