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

fix(media-types): return video/mp4 for .mp4 extension #5475

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 18, 2024

closes #5433

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.35%. Comparing base (702f048) to head (eda1eea).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5475   +/-   ##
=======================================
  Coverage   96.34%   96.35%           
=======================================
  Files         463      463           
  Lines       37725    37726    +1     
  Branches     5566     5567    +1     
=======================================
+ Hits        36348    36349    +1     
  Misses       1335     1335           
  Partials       42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

This makes me wonder if there are any extensions that are incorrect. E.g. .mpg4 should return video/mp4, but it also returns video/mp4. We should probably come up with some better way to calculate preference in a follow-up PR.

This is a quick and dirty script to help find which extensions have more than one content-type:

import db from "./media_types/vendor/db.ts";

const result: Record<string, string[]> = {};

for (const [key, value] of Object.entries(db)) {
  if (Array.isArray(value.extensions)) {
    for (const ext of value.extensions) {
      if (!result[ext]) {
        result[ext] = [];
      }
      result[ext].push(key);
    }
  }
}

for (const [ext, contentTypes] of Object.entries(result)) {
  if (contentTypes.length > 1) console.log([ext, contentTypes]);
}

@kt3k kt3k merged commit fd3e286 into denoland:main Jul 18, 2024
16 checks passed
@kt3k kt3k deleted the fix-prefer-video-mp4 branch July 18, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants