diff --git a/CloudServer/server.js b/CloudServer/server.js index b11cea4..4b102bf 100644 --- a/CloudServer/server.js +++ b/CloudServer/server.js @@ -148,44 +148,44 @@ function safeRelativeToBase(baseDir, relativePath) { return full; } -app.get('/media/audio/general/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/general/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const candidates = getBeepAudioDirs().map(dir => safeRelativeToBase(dir, rel)).filter(Boolean); sendBinaryFileFromCandidates(res, candidates); }); -app.get('/media/audio/beep/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/beep/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const candidates = getBeepAudioDirs().map(dir => safeRelativeToBase(dir, rel)).filter(Boolean); sendBinaryFileFromCandidates(res, candidates); }); -app.get('/media/audio/music/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/music/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const full = safeRelativeToBase(audioMusicDir, rel); if (!full) return res.status(404).end(); sendBinaryFile(res, full); }); -app.get('/media/audio/voice/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/voice/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const full = safeRelativeToBase(audioVoiceDir, rel); if (!full) return res.status(404).end(); sendBinaryFile(res, full); }); -app.get('/media/audio/line/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/line/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const full = safeRelativeToBase(audioLineDir, rel); if (!full) return res.status(404).end(); sendBinaryFile(res, full); }); -app.get('/media/audio/station/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/audio/station/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const full = safeRelativeToBase(audioStationDir, rel); if (!full) return res.status(404).end(); sendBinaryFile(res, full); }); -app.get('/media/temp/*', (req, res) => { - const rel = req.params[0] || ''; +app.get('/media/temp/:relPath(.*)', (req, res) => { + const rel = req.params.relPath || ''; const full = safeRelativeToBase(tempBroadcastDir, rel); if (!full) return res.status(404).end(); sendBinaryFile(res, full); diff --git a/station_broadcast.lua b/station_broadcast.lua index 0aea9b8..d455c29 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -1,6 +1,6 @@ -- 1. Configuration & Constants -local APP_VERSION_TEXT = "v1.0.100" +local APP_VERSION_TEXT = "v1.0.101" local CONFIG = { CLOUD_URL = "ws://stabadmin.fse-media.group",