From 01124ba83401d632009f4fcd172b6ec826f9eb1f Mon Sep 17 00:00:00 2001 From: Kentai Radiquum Date: Tue, 18 Feb 2025 21:29:04 +0500 Subject: [PATCH] feat/admin: use image thumbs --- admin/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/main.py b/admin/main.py index 643ad7a..b97a171 100644 --- a/admin/main.py +++ b/admin/main.py @@ -56,7 +56,9 @@ def Home(): for object in db_objects: name = object.id - img = f"{object.id.split(".")[0]}/{object.id}" + path = name.split('.')[0] + ext = name.split('.')[-1] + img = f"{path}/{path}-512.{ext}" obj = object.to_dict() date = datetime.fromtimestamp(float(float(str(obj["date"])[:10]))).strftime( @@ -235,7 +237,9 @@ def Edit(id): document = db.collection(os.getenv("PREFIX")).document(id).get() if document.exists: name = document.id - img = f"{document.id.split(".")[0]}/{document.id}" + path = name.split('.')[0] + ext = name.split('.')[-1] + img = f"{path}/{path}-512.{ext}" obj = document.to_dict() tags = obj["tags"]