From d4b31b333101199ce1ad5774110de3e41534613b Mon Sep 17 00:00:00 2001
From: Kentai Radiquum <kentai.waah@gmail.com>
Date: Fri, 21 Feb 2025 02:15:01 +0500
Subject: [PATCH] remove: 256px thumbnails generation

---
 admin/main.py            | 6 ------
 generate/build.tsx       | 2 --
 generate/data/items.json | 1 -
 generate/data/tags.json  | 1 -
 4 files changed, 10 deletions(-)
 delete mode 100644 generate/data/items.json
 delete mode 100644 generate/data/tags.json

diff --git a/admin/main.py b/admin/main.py
index aab156f..f3587e4 100644
--- a/admin/main.py
+++ b/admin/main.py
@@ -23,7 +23,6 @@ SIZES = [
     (2048, 2048),
     (1024, 1024),
     (512, 512),
-    (256, 256),
 ]
 
 app = Flask(__name__)
@@ -242,10 +241,6 @@ def ApiUpload():
                 Bucket=os.getenv("AWS_BUCKET"),
                 Key=f"{file_path}/{file_path}-{SIZES[2][0]}.{file_ext}",
             )
-            s3.delete_object(
-                Bucket=os.getenv("AWS_BUCKET"),
-                Key=f"{file_path}/{file_path}-{SIZES[3][0]}.{file_ext}",
-            )
             s3.delete_object(Bucket=os.getenv("AWS_BUCKET"), Key=f"{file_path}/")
             return Response(
                 json.dumps({"status": "error", "message": f"S3 ERR: {s3Response}"}),
@@ -257,7 +252,6 @@ def ApiUpload():
     os.remove(os.path.join(app.config["UPLOAD_FOLDER"], f"{file_path}-{SIZES[0][0]}.{file_ext}"))
     os.remove(os.path.join(app.config["UPLOAD_FOLDER"], f"{file_path}-{SIZES[1][0]}.{file_ext}"))
     os.remove(os.path.join(app.config["UPLOAD_FOLDER"], f"{file_path}-{SIZES[2][0]}.{file_ext}"))
-    os.remove(os.path.join(app.config["UPLOAD_FOLDER"], f"{file_path}-{SIZES[3][0]}.{file_ext}"))
 
     return {"status": "ok", "message": "Uploaded"}
 
diff --git a/generate/build.tsx b/generate/build.tsx
index 9dd8477..49fb1c1 100644
--- a/generate/build.tsx
+++ b/generate/build.tsx
@@ -35,7 +35,6 @@ export interface Url {
 }
 
 interface ThumbnailSize {
-  "256": string;
   "512": string;
   "1024": string;
   "2048": string;
@@ -94,7 +93,6 @@ if (
           id: doc.id,
           image: `${ENDPOINT}/${BUCKET}/${path}/${path}.${ext}`,
           thumbnail: {
-            "256": `${ENDPOINT}/${BUCKET}/${path}/${path}-256.${ext}`,
             "512": `${ENDPOINT}/${BUCKET}/${path}/${path}-512.${ext}`,
             "1024": `${ENDPOINT}/${BUCKET}/${path}/${path}-1024.${ext}`,
             "2048": `${ENDPOINT}/${BUCKET}/${path}/${path}-2048.${ext}`
diff --git a/generate/data/items.json b/generate/data/items.json
deleted file mode 100644
index 26159ce..0000000
--- a/generate/data/items.json
+++ /dev/null
@@ -1 +0,0 @@
-{"2025":[{"id":"IMG_20241225_133609_1.jpg","image":"https://s3.tebi.io/radiquum-photos/IMG_20241225_133609_1/IMG_20241225_133609_1.jpg","thumbnail":{"256":"https://s3.tebi.io/radiquum-photos/IMG_20241225_133609_1/IMG_20241225_133609_1-256.jpg","512":"https://s3.tebi.io/radiquum-photos/IMG_20241225_133609_1/IMG_20241225_133609_1-512.jpg","1024":"https://s3.tebi.io/radiquum-photos/IMG_20241225_133609_1/IMG_20241225_133609_1-1024.jpg","2048":"https://s3.tebi.io/radiquum-photos/IMG_20241225_133609_1/IMG_20241225_133609_1-2048.jpg"},"alt":"","tags":[],"urls":[],"mimetype":"image/jpeg","width":3472,"height":4624,"date":1740078000000},{"id":"ilse-orsel-PIlkIuwFhd0-unsplash.jpg","image":"https://s3.tebi.io/radiquum-photos/ilse-orsel-PIlkIuwFhd0-unsplash/ilse-orsel-PIlkIuwFhd0-unsplash.jpg","thumbnail":{"256":"https://s3.tebi.io/radiquum-photos/ilse-orsel-PIlkIuwFhd0-unsplash/ilse-orsel-PIlkIuwFhd0-unsplash-256.jpg","512":"https://s3.tebi.io/radiquum-photos/ilse-orsel-PIlkIuwFhd0-unsplash/ilse-orsel-PIlkIuwFhd0-unsplash-512.jpg","1024":"https://s3.tebi.io/radiquum-photos/ilse-orsel-PIlkIuwFhd0-unsplash/ilse-orsel-PIlkIuwFhd0-unsplash-1024.jpg","2048":"https://s3.tebi.io/radiquum-photos/ilse-orsel-PIlkIuwFhd0-unsplash/ilse-orsel-PIlkIuwFhd0-unsplash-2048.jpg"},"alt":"","tags":[],"urls":[],"mimetype":"image/jpeg","width":6960,"height":4640,"date":1740078000000}]}
\ No newline at end of file
diff --git a/generate/data/tags.json b/generate/data/tags.json
deleted file mode 100644
index 0637a08..0000000
--- a/generate/data/tags.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file