Merge pull request #154 from tadscottsmith/allow-mp3

Allow MP3 files.
This commit is contained in:
Luke Berndt
2023-11-21 21:42:30 -05:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -197,7 +197,7 @@ const createPodcast = async (tmpEventFolder, podcastFile, event) => {
command.push("-i");
command.push(concatFile);
command.push("-acodec");
command.push("copy");
command.push("aac");
command.push(tmpFile);
//console.log("Running command: " + command);
await ffmpeg(command);

View File

@@ -23,7 +23,7 @@ const client = new S3Client({
exports.upload = async function (req, res, next) {
process.nextTick( async () => {
if (!req.file || (path.extname(req.file.originalname)) != '.m4a') {
if (!req.file || ((path.extname(req.file.originalname) != '.m4a') && (path.extname(req.file.originalname) != '.mp3'))) {
console.warn("[" + req.params.shortName + "] Error file name is wrong or file does not exist");
res.status(500);
res.send("Error, invalid filename:\n");
@@ -111,7 +111,7 @@ exports.upload = async function (req, res, next) {
res.status(200).end();
var local_path = "/" + shortName + "/" + time.getFullYear() + "/" + (time.getMonth() + 1) + "/" + time.getDate() + "/";
var object_key = "media/" + shortName + "-" + talkgroupNum + "-" + startTime + ".m4a";
var object_key = "media/" + shortName + "-" + talkgroupNum + "-" + startTime + path.extname(req.file.originalname);
var endpoint = s3_endpoint;
var bucket = s3_bucket;