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

api: Allow finding an asset by CID (of video or metadata) #1153

Merged
merged 12 commits into from
Aug 8, 2022

Conversation

victorges
Copy link
Member

What does this pull request do? Explain your changes. (required)

This is to allow finding an asset from its CID (of video or metadata).

It will allow clean-up of pins in any IPFS provider, so that we only actually delete
the Pin when there are no more assets pointing to that same file.

Will also allow unpinning of previous metadata when the NFT metadata changes,
following that same principle/api.

Specific updates (required)

  • Allow indexes of nested properties
  • Add index to CID fields
  • Allow filtering by them on the /asset API

-

  • How did you test each of these updates (required)
  • yarn test
  • to-do: Query for an asset using its CIDs and check it's findable

Does this pull request close any open issues?
Not really, but it's related to the current Piñata incident that we're having. Gotta create an issue for that.

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@victorges victorges requested a review from a team as a code owner July 12, 2022 21:36
@vercel
Copy link

vercel bot commented Jul 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
livepeer-studio ❌ Failed (Inspect) Aug 8, 2022 at 6:41PM (UTC)

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #1153 (ae967da) into master (f3846c4) will increase coverage by 0.08351%.
The diff coverage is 87.50000%.

❗ Current head ae967da differs from pull request most recent head 6204636. Consider uploading reports for the commit 6204636 to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1153         +/-   ##
===================================================
+ Coverage   50.42057%   50.50408%   +0.08351%     
===================================================
  Files             66          66                 
  Lines           4161        4166          +5     
  Branches         735         736          +1     
===================================================
+ Hits            2098        2104          +6     
  Misses          1816        1816                 
+ Partials         247         246          -1     
Impacted Files Coverage Δ
packages/api/src/controllers/asset.ts 46.49123% <ø> (ø)
packages/api/src/store/table.ts 69.53642% <87.50000%> (+1.26056%) ⬆️
packages/api/src/webhooks/cannon.ts 47.95322% <0.00000%> (+0.27880%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f70c43...6204636. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/controllers/asset.ts 46.49123% <ø> (ø)
packages/api/src/store/table.ts 69.53642% <87.50000%> (+1.26056%) ⬆️
packages/api/src/webhooks/cannon.ts 47.95322% <0.00000%> (+0.27880%) ⬆️

@victorges victorges merged commit bb6093c into master Aug 8, 2022
@victorges victorges deleted the vg/feat/find-asset-by-cid branch August 8, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants