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

Add a file extension to download url #2314

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add a file extension to download url #2314

wants to merge 2 commits into from

Conversation

mjh1
Copy link
Contributor

@mjh1 mjh1 commented Sep 18, 2024

This relies on a CDN rule to re-route the request to the standard /video path. I'll probably put it behind an experiment to begin with and also probably should have the mapping of format to file extension in catalyst.

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

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

Screenshots (optional)

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.

@mjh1 mjh1 requested a review from a team as a code owner September 18, 2024 11:57
Copy link

vercel bot commented Sep 18, 2024

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

Name Status Preview Comments Updated (UTC)
livepeer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 0:00am

base,
asset.playbackId,
source.path,
"download." + formatToFileExtension.get(asset.videoSpec.format),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt of naming the file with the asset name instead?

Suggested change
"download." + formatToFileExtension.get(asset.videoSpec.format),
encodeURIComponent(`${asset.name}.${formatToFileExtension.get(asset.videoSpec.format)}`),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only issue with that is that the name for direct uploads will contain the original file extension and so they'll end up with double file extensions :(
Screenshot 2024-09-19 at 12 21 13

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could just strip anything after the final .?

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.

2 participants