Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify metadata on image worker #155

Closed
vikiival opened this issue Sep 25, 2023 · 3 comments · Fixed by #206
Closed

Unify metadata on image worker #155

vikiival opened this issue Sep 25, 2023 · 3 comments · Fixed by #206
Labels

Comments

@vikiival
Copy link
Member

  1. install hyperdata
  2. when content is application/json do normalization
  3. save to R2 (as it is now)
@vikiival
Copy link
Member Author

@preschian thinking what if we store JSON metadata somewhere else? like KV or D1 ?

@preschian
Copy link
Member

@vikiival oh yes, I'm thinking like this also if we put that in our workers. ref: #95

create a new endpoint, something like image-w.com/metadata/cid
if the content non-json, redirect it to our normal image workers to image-w.com/ipfs/cid
else return our predefined structure, something like this:

{
  media: '', // img/3d/audio/video
  thumbnail: '', // future research if the media non-image. is it possible or not to create a thumbnail from that in workers. ref: https://github.com/kodadot/nft-gallery/issues/6050
  mimeType: '',
  raw: {
    ...,
    // keep original metadata from ipfs here
    ...,
  }
}

@vikiival
Copy link
Member Author

vikiival commented Oct 6, 2023

media

Should I rename animationUrl to Media?

Also raw was added as _raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants