From b8d478a97e84534385399a6e388a1fb13532a56f Mon Sep 17 00:00:00 2001 From: Lesenelir Z Date: Sat, 5 Aug 2023 21:46:28 +0800 Subject: [PATCH] fix: resolve issue with NFTs content_uri starting with svg (#868) --- src/app/api/score/route.ts | 10 +++++----- src/app/site/[site]/nft/page.tsx | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/api/score/route.ts b/src/app/api/score/route.ts index 97d59d75..6f62effe 100644 --- a/src/app/api/score/route.ts +++ b/src/app/api/score/route.ts @@ -72,7 +72,7 @@ async function getScore(cid: string) { noUpdate: true, noExpire: true, getValueFun: async () => { - let resut + let result await lock.acquire(cid, async () => { const meta = await prisma.metadata.findFirst({ where: { @@ -81,7 +81,7 @@ async function getScore(cid: string) { }) if (meta) { if (meta?.ai_score !== null) { - resut = { + result = { number: meta.ai_score, reason: meta.ai_score_reason, } @@ -98,7 +98,7 @@ async function getScore(cid: string) { }, }) - resut = score + result = score } } } else { @@ -112,11 +112,11 @@ async function getScore(cid: string) { }, }) - resut = score + result = score } } }) - return resut + return result }, }) diff --git a/src/app/site/[site]/nft/page.tsx b/src/app/site/[site]/nft/page.tsx index c12db52a..48d9925c 100644 --- a/src/app/site/[site]/nft/page.tsx +++ b/src/app/site/[site]/nft/page.tsx @@ -109,6 +109,10 @@ export default async function SiteNFTPage({ nft.content_uri?.startsWith?.("http") || nft.content_uri?.startsWith?.("data:") ? nft.content_uri + : nft.content_uri?.startsWith?.("