From 0f2170869f190708f8abe970b95b49d1df87535f Mon Sep 17 00:00:00 2001 From: William Chong Date: Thu, 12 Dec 2024 12:44:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=94=20Use=20ISCN=20thumbnailUrl=20for?= =?UTF-8?q?=20image=20if=20nft=20not=20ar://?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/nft.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/mixins/nft.js b/src/mixins/nft.js index f498b1cbc..750adb6b5 100644 --- a/src/mixins/nft.js +++ b/src/mixins/nft.js @@ -215,11 +215,19 @@ export default { }, NFTImageUrl() { const { image = '' } = this.NFTClassMetadata; - return parseNFTMetadataURL(image); + let url = image; + if (!url.startsWith('ar://') && this.iscnThumbnailUrl) { + url = this.iscnThumbnailUrl; + } + return parseNFTMetadataURL(url); }, nftImageURL() { - const image = this.nftMetadata.image || this.NFTImageUrl; - return parseNFTMetadataURL(image); + const { image = '' } = this.nftMetadata; + let url = image; + if (!url.startsWith('ar://') && this.iscnThumbnailUrl) { + url = this.iscnThumbnailUrl; + } + return parseNFTMetadataURL(url) || this.NFTImageUrl; }, NFTAnimationUrl() { const { animation_url: video = '' } = this.NFTClassMetadata; @@ -266,6 +274,9 @@ export default { iscnUrl() { return this.iscnData?.contentMetadata?.url; }, + iscnThumbnailUrl() { + return this.iscnData?.contentMetadata?.thumbnailUrl; + }, iscnContentUrls() { return this.iscnData?.contentMetadata?.sameAs || []; },