Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
Correct mime types package
Browse files Browse the repository at this point in the history
  • Loading branch information
hardiesoft committed Jun 16, 2021
1 parent 2938f46 commit 6d1a6d0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/V1/recordingUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ async function delete_(request, response) {
}

function guessRawMimeType(type, filename) {
const mimeType = mime.lookup(filename);
const mimeType = mime.getType(filename);
if (mimeType) {
return mimeType;
}
Expand Down
4 changes: 2 additions & 2 deletions models/Recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ from (
if (this.rawMimeType == "application/x-cptv") {
return ".cptv";
}
const ext = mime.extension(this.rawMimeType);
const ext = mime.getExtension(this.rawMimeType);
if (ext) {
return "." + ext;
}
Expand Down Expand Up @@ -868,7 +868,7 @@ from (
if (this.fileMimeType == "application/x-cptv") {
return ".cptv";
}
const ext = mime.extension(this.fileMimeType);
const ext = mime.getExtension(this.fileMimeType);
if (ext) {
return "." + ext;
}
Expand Down
2 changes: 1 addition & 1 deletion models/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function getFileName(model) {
fileName = "file";
}

const ext = mime.extension(model.getDataValue("mimeType") || "");
const ext = mime.getExtension(model.getDataValue("mimeType") || "");
if (ext) {
fileName = fileName + "." + ext;
}
Expand Down
25 changes: 19 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"@types/express": "^4.17.4",
"@types/jsonwebtoken": "^8.3.8",
"@types/mime": "^2.0.3",
"apidoc": "^0.20.0",
"aws-sdk": "^2.653.0",
"bcrypt": "^5.0.1",
Expand Down

0 comments on commit 6d1a6d0

Please sign in to comment.