toques finais
Deploy / Deploy (push) Successful in 2m14s Details

This commit is contained in:
JotaChina 2026-02-08 14:07:47 -03:00
parent 357eeb937b
commit e8ab0b8f42
1 changed files with 7 additions and 8 deletions

View File

@ -247,7 +247,7 @@ const io = new Server(httpsServer, {
},
});
console.log("Backend V6 (Logs Dinâmicos) iniciado. Aguardando conexões...");
console.log("Servidor Backend do MMP-Search está no ar!");
// util de log das salas deste socket
function logMyRooms(socket, prefix = "SALAS") {
@ -638,7 +638,6 @@ app.use(express.json({ limit: "250mb" }));
app.use((req, res, next) => {
const origin = req.headers.origin;
// ajuste se você usa outros hosts no dev
const allowed = new Set([
"https://alice.ufsj.edu.br",
]);
@ -659,7 +658,7 @@ const LMMS_BIN = process.env.LMMS_BIN || "lmms";
const LMMS_TIMEOUT_MS = Number(process.env.LMMS_TIMEOUT_MS || 5 * 60 * 1000);
function buildLmmsCommand(inputMmp, outputAudio, ext) {
// igual ao Python: -r input -o output -f ext
// igual ao Python: -r input -o output -f ext
const lmmsArgs = ["-r", inputMmp, "-o", outputAudio, "-f", ext];
// Só usa xvfb se você pedir explicitamente
@ -772,7 +771,7 @@ app.post("/render", async (req, res) => {
let inputMmpPath = null;
let cwdForLmms = tmpDir;
// caminho novo: veio pacote (mmpz/zip) com samples/
// caminho novo: veio pacote (mmpz/zip) com samples/
if (mmpzBase64 && String(mmpzBase64).trim().length > 0) {
const safeName = sanitizeFileName(mmpzName || "project.mmpz");
const zipPath = path.join(tmpDir, safeName);
@ -783,7 +782,7 @@ app.post("/render", async (req, res) => {
inputMmpPath = await findFirstMmp(tmpDir);
if (!inputMmpPath) throw new Error("nenhum .mmp encontrado após extrair o pacote");
cwdForLmms = path.dirname(inputMmpPath); // 🔥 isso faz o LMMS resolver samples/...
cwdForLmms = path.dirname(inputMmpPath); // isso faz o LMMS resolver samples/...
} else {
// fallback antigo: xml puro (patterns ok, samples não)
let projectXml = null;
@ -828,7 +827,7 @@ app.post("/notify-update", express.json(), (req, res) => {
if (updateType === "samples") {
// 1. Emitir o evento para TODAS as salas/clientes.
// O evento deve ser algo que seu ui.js entenda.
// O evento deve ser algo que ui.js entenda.
io.emit("system_update", {
type: "RELOAD_SAMPLES",
message: "Novo Sample/Project adicionado. Recarregando o navegador de arquivos...",
@ -845,11 +844,11 @@ app.post("/notify-update", express.json(), (req, res) => {
app.get("/", (req, res) => {
res.send(
"Servidor Backend V6 (Logs Dinâmicos) da DAW colaborativa está no ar!"
"Servidor Backend do MMP-Search está no ar novamente!"
);
});
// ====== START ======
httpsServer.listen(PORT, () => {
console.log(`Servidor escutando na porta https://localhost:${PORT}`);
console.log(`Servidor escutando na porta ${PORT}`);
});