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:
Shinuwa 2026-11-29 11:59:58 +01:00
parent 6ca17264e0
commit a1cefe6da5
7 changed files with 363 additions and 77 deletions

View file

@ -171,7 +171,8 @@ function createQueueTrackFromLibrary(libraryTrack, requestedBy = "library") {
};
}
function cleanupTemporaryFiles(maxAge = TEMP_FILE_MAX_AGE) {
// keep : chemins encore utilisés (file d'attente, morceau en cours), jamais supprimés.
function cleanupTemporaryFiles(maxAge = TEMP_FILE_MAX_AGE, { keep = new Set() } = {}) {
ensureStorageLayout();
const cutoff = Date.now() - maxAge;
@ -181,6 +182,9 @@ function cleanupTemporaryFiles(maxAge = TEMP_FILE_MAX_AGE) {
}
const filePath = path.join(TEMP_DIR, entry.name);
if (keep.has(filePath)) {
continue;
}
try {
if (fs.statSync(filePath).mtimeMs < cutoff) {
fs.unlinkSync(filePath);