Fix jukebox playback getting stuck and make the web page reflect actions
- Adding a track or someone joining the voice channel now resumes a queue suspended because the bot was alone; before, only the Play button did. - Retry the voice connection with backoff instead of giving up after one failed attempt. - Keep playing when the head of the queue changes while connecting. - Requeue the interrupted track when the bot leaves an empty channel or loses its voice connection. - Removing the current track no longer answers 404; other bots no longer count as listeners. - Accept uploads whatever MIME type the browser sends (ffprobe validates the content) and clean temporary files hourly, sparing queued ones. - Web page: refresh again after an action instead of reusing a stale request, disable buttons while a request runs, show the real start time and custom titles, and support drag and drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ca17264e0
commit
a1cefe6da5
7 changed files with 363 additions and 77 deletions
|
|
@ -8,19 +8,9 @@ import {
|
|||
registerUploadedFile,
|
||||
} from "../storage/storageManager.js";
|
||||
|
||||
const ALLOWED_AUDIO_TYPES = new Set([
|
||||
"audio/aac",
|
||||
"audio/flac",
|
||||
"audio/mp4",
|
||||
"audio/mpeg",
|
||||
"audio/ogg",
|
||||
"audio/wav",
|
||||
"audio/webm",
|
||||
"audio/x-flac",
|
||||
"audio/x-m4a",
|
||||
"audio/x-wav",
|
||||
]);
|
||||
|
||||
// Pas de filtre sur le type MIME : il vient du navigateur et varie selon le système (un MP3
|
||||
// peut arriver en « audio/mp3 », un FLAC sans type). Les fichiers refusés disparaissaient sans
|
||||
// message clair ; ffprobe vérifie le contenu réel après l'envoi.
|
||||
const upload = multer({
|
||||
dest: TEMP_DIR,
|
||||
limits: {
|
||||
|
|
@ -35,7 +25,7 @@ const upload = multer({
|
|||
callback(error);
|
||||
return;
|
||||
}
|
||||
callback(null, ALLOWED_AUDIO_TYPES.has(file.mimetype));
|
||||
callback(null, true);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue