diff --git a/.gitignore b/.gitignore index 7b9072f..f563172 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .vercel +.env*.local diff --git a/api/_lib/handlers.js b/api/_lib/handlers.js index 720e52d..65af36e 100644 --- a/api/_lib/handlers.js +++ b/api/_lib/handlers.js @@ -38,6 +38,7 @@ const { sendJson, } = require('./http'); const { sendSubmissionNotification } = require('./ntfy'); +const staticCommissions = require('./static-commissions.json'); const SUBMISSION_RATE_LIMIT_WINDOW_MS = 10 * 60 * 1000; const SUBMISSION_RATE_LIMIT_MAX = 5; @@ -293,8 +294,24 @@ async function handleListPublicCommissions(req, res) { noStore(res); try { + let dynamicCommissions = []; + try { + dynamicCommissions = await getPublicCommissions(); + } catch (error) { + // If Blob-backed commissions are unavailable, still serve static commissions. + // Log the failure so production issues remain visible. + // eslint-disable-next-line no-console + console.error('Failed to load dynamic commissions:', error.message); + } + + const dynamicIds = new Set(dynamicCommissions.map(entry => entry.id)); + const merged = [ + ...dynamicCommissions, + ...staticCommissions.filter(entry => !dynamicIds.has(entry.id)), + ]; + sendJson(res, 200, { - commissions: await getPublicCommissions(), + commissions: merged, }); } catch (error) { sendError( diff --git a/api/_lib/static-commissions.json b/api/_lib/static-commissions.json new file mode 100644 index 0000000..b2e8634 --- /dev/null +++ b/api/_lib/static-commissions.json @@ -0,0 +1,28 @@ +[ + { + "id": "static_screenshot_proto_20260726", + "artistName": "screenshot.proto", + "artistLink": "https://www.tiktok.com/@screenshot.proto", + "date": "2026-07-26", + "description": "", + "gridIndex": null, + "imageUrl": "/custom/commissions/screenshot-proto-2026-07-26.webp", + "iconUrl": "/custom/commissions/icons/screenshot-proto-2026-07-26.png", + "mimeType": "image/webp", + "width": 3464, + "height": 3464 + }, + { + "id": "static_veevee_20260730", + "artistName": "veevee", + "artistLink": "https://lightdrawingzs.carrd.co/", + "date": "2026-07-30", + "description": "", + "gridIndex": null, + "imageUrl": "/custom/commissions/veevee-2026-07-30.webp", + "iconUrl": "/custom/commissions/icons/veevee-2026-07-30.png", + "mimeType": "image/webp", + "width": 1280, + "height": 1280 + } +] diff --git a/public/custom/commissions/icons/screenshot-proto-2026-07-26.png b/public/custom/commissions/icons/screenshot-proto-2026-07-26.png new file mode 100644 index 0000000..2f9d0c0 Binary files /dev/null and b/public/custom/commissions/icons/screenshot-proto-2026-07-26.png differ diff --git a/public/custom/commissions/icons/veevee-2026-07-30.png b/public/custom/commissions/icons/veevee-2026-07-30.png new file mode 100644 index 0000000..59d2745 Binary files /dev/null and b/public/custom/commissions/icons/veevee-2026-07-30.png differ diff --git a/public/custom/commissions/screenshot-proto-2026-07-26.webp b/public/custom/commissions/screenshot-proto-2026-07-26.webp new file mode 100644 index 0000000..4c288da Binary files /dev/null and b/public/custom/commissions/screenshot-proto-2026-07-26.webp differ diff --git a/public/custom/commissions/veevee-2026-07-30.webp b/public/custom/commissions/veevee-2026-07-30.webp new file mode 100644 index 0000000..ea182a3 Binary files /dev/null and b/public/custom/commissions/veevee-2026-07-30.webp differ