move the populate function to separate file

This commit is contained in:
geoffrey45 committed 2022-05-04 01:36:27 +03:00
1 parent 1e7af1a800
commit 4c09350b41
6 files changed
+195 -142

No files matched your search

+6 -8
View File
@@ -23,12 +23,11 @@ def hello():
@app.route("/thumb/<path>")
def send_thumbnail(path: str):
name = path + ".webp"
path = join(THUMB_PATH, name)
exists = os.path.exists(path)
fpath = join(THUMB_PATH, path)
exists = os.path.exists(fpath)
if exists:
return send_from_directory(THUMB_PATH, name)
return send_from_directory(THUMB_PATH, path)
return {"msg": "Not found"}, 404
@@ -36,12 +35,11 @@ def send_thumbnail(path: str):
@app.route("/artist/<path>")
def send_artist_image(path: str):
print(ARTIST_PATH)
name = path + ".webp"
path = join(ARTIST_PATH, name)
exists = os.path.exists(path)
fpath = join(ARTIST_PATH, path)
exists = os.path.exists(fpath)
if exists:
return send_from_directory(ARTIST_PATH, name)
return send_from_directory(ARTIST_PATH, path)
return {"msg": "Not found"}, 404