Open preschian opened 8 months ago
Hi, @kodadot/internal-dev, I need help with someone already familiar with indexer. I added new endpoints on our image-workers:
image-workers
/metadata
/video
With the /metadata endpoint, we can get mimeType for media and animated media
media
animated media
https://image-beta.w.kodadot.xyz/metadata?url=https%3A%2F%2Fimage-beta.w.kodadot.xyz%2Fipfs%2Fbafybeif7qqgorl7bf5227jeg337qlwlqdi6t3p3cuxhn4mnzw6ffkbqdla%2F111.json
will return
{ "imageMimeType": "image/jpeg", "animationUrlMimeType": "text/html", ... }
Or, you can directly call HEAD request to the metadata itself.
I think once we can store that on the indexer, we can continue with these issues:
With the /video endpoint, we can upload video to cf-stream. Once the processing is done, we can get the video thumbnail. Once we can store the proper thumbnail in the indexer, we can fix our preview image:
video
Metadata from one of the items for that collection is something like this:
{ "name": "Polkadot @ EthDenver 2023", "image": "ipfs://ipfs/QmT2yg18YvYdECQcy5VJ4NYUd1dvVUjxJEhqiKBcMgS5UF", "description": "Polkadot @ EthDenver 2023" }
As you can see, the actual media is video. But it is stored in the image key. And there is no metadata for the actual image/thumbnail.
image
Why we need to store it on the indexer: check MimeType on the client, which will be flooded on the network request. Loading all mp4s on the explorer will be laggy for the user. https://github.com/kodadot/nft-gallery/pull/6364#pullrequestreview-1506630564
MimeType
maybe something can be done with https://github.com/kodadot/stick/blob/cb6133ed1dd16d440db60660c461a988dcc9dcae/src/mappings/utils/metadata.ts#L9
Hi, @kodadot/internal-dev, I need help with someone already familiar with indexer. I added new endpoints on our
image-workers
:/metadata
/video
/metadata
endpointWith the
/metadata
endpoint, we can get mimeType formedia
andanimated media
will return
Or, you can directly call HEAD request to the metadata itself.
I think once we can store that on the indexer, we can continue with these issues:
/video
endpointWith the
/video
endpoint, we can uploadvideo
to cf-stream. Once the processing is done, we can get the video thumbnail. Once we can store the proper thumbnail in the indexer, we can fix our preview image:Metadata from one of the items for that collection is something like this:
As you can see, the actual media is
video
. But it is stored in theimage
key. And there is no metadata for the actual image/thumbnail.Why we need to store it on the indexer: check
MimeType
on the client, which will be flooded on the network request. Loading all mp4s on the explorer will be laggy for the user. https://github.com/kodadot/nft-gallery/pull/6364#pullrequestreview-1506630564