mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 15:49:34 +05:00
feat: add view of all packs
This commit is contained in:
parent
802b755d29
commit
e109b5393a
7 changed files with 114 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
from . import apiPack
|
||||
from flask import request, jsonify, send_file, redirect
|
||||
from flask import request, jsonify, send_file, redirect, url_for
|
||||
from config import PACKS_FOLDER, IMG_ALLOWED_MIME
|
||||
from PIL import Image
|
||||
from io import BytesIO
|
||||
|
@ -11,7 +11,7 @@ import base64
|
|||
@apiPack.route("/<id>/image", methods=["GET"])
|
||||
def getPackImage(id):
|
||||
if not os.path.exists(f"{PACKS_FOLDER}/{id}/packicon.png"):
|
||||
return redirect("/favicon.ico")
|
||||
return redirect(url_for("static", filename="defaulticon.png"))
|
||||
|
||||
return send_file(f"{PACKS_FOLDER}/{id}/packicon.png")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue