Skip to content

Commit

Permalink
👔 Use ISCN thumbnailUrl for image if nft not ar://
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 12, 2024
1 parent d071e10 commit 0f21708
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -266,6 +274,9 @@ export default {
iscnUrl() {
return this.iscnData?.contentMetadata?.url;
},
iscnThumbnailUrl() {
return this.iscnData?.contentMetadata?.thumbnailUrl;
},
iscnContentUrls() {
return this.iscnData?.contentMetadata?.sameAs || [];
},
Expand Down

0 comments on commit 0f21708

Please sign in to comment.