Upload m4a as audio/mp4; embed audio/mp4, x-flac, and x-m4a (#4470)

* 'audio/x-m4a' should be 'audio/mp4'
* add handling for x-flac and x-m4a
This commit is contained in:
xnaas 2022-02-11 19:42:59 -06:00 committed by GitHub
parent 4be9a282fa
commit 9dfb2a3fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,8 @@ function parse(msg, chan, preview, res, client) {
case "audio/x-mpeg": case "audio/x-mpeg":
case "audio/x-mpeg-3": case "audio/x-mpeg-3":
case "audio/flac": case "audio/flac":
case "audio/x-flac":
case "audio/mp4":
case "audio/x-m4a": case "audio/x-m4a":
if (!preview.link.startsWith("https://")) { if (!preview.link.startsWith("https://")) {
break; break;

View File

@ -117,6 +117,8 @@ class Uploader {
detectedMimeType = "audio/wav"; detectedMimeType = "audio/wav";
} else if (detectedMimeType === "audio/x-flac") { } else if (detectedMimeType === "audio/x-flac") {
detectedMimeType = "audio/flac"; detectedMimeType = "audio/flac";
} else if (detectedMimeType === "audio/x-m4a") {
detectedMimeType = "audio/mp4";
} }
res.setHeader("Content-Disposition", disposition); res.setHeader("Content-Disposition", disposition);