mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 17:58:02 -05:00
@@ -197,7 +197,7 @@ const createPodcast = async (tmpEventFolder, podcastFile, event) => {
|
|||||||
command.push("-i");
|
command.push("-i");
|
||||||
command.push(concatFile);
|
command.push(concatFile);
|
||||||
command.push("-acodec");
|
command.push("-acodec");
|
||||||
command.push("copy");
|
command.push("aac");
|
||||||
command.push(tmpFile);
|
command.push(tmpFile);
|
||||||
//console.log("Running command: " + command);
|
//console.log("Running command: " + command);
|
||||||
await ffmpeg(command);
|
await ffmpeg(command);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const client = new S3Client({
|
|||||||
|
|
||||||
exports.upload = async function (req, res, next) {
|
exports.upload = async function (req, res, next) {
|
||||||
process.nextTick( async () => {
|
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");
|
console.warn("[" + req.params.shortName + "] Error file name is wrong or file does not exist");
|
||||||
res.status(500);
|
res.status(500);
|
||||||
res.send("Error, invalid filename:\n");
|
res.send("Error, invalid filename:\n");
|
||||||
@@ -111,7 +111,7 @@ exports.upload = async function (req, res, next) {
|
|||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
|
|
||||||
var local_path = "/" + shortName + "/" + time.getFullYear() + "/" + (time.getMonth() + 1) + "/" + time.getDate() + "/";
|
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 endpoint = s3_endpoint;
|
||||||
var bucket = s3_bucket;
|
var bucket = s3_bucket;
|
||||||
|
|||||||
Reference in New Issue
Block a user