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
|
|
@ -101,9 +101,17 @@ function createApp(
|
|||
return app;
|
||||
}
|
||||
|
||||
const TEMP_CLEANUP_INTERVAL = 60 * 60_000;
|
||||
|
||||
function startWebServer(dependencies) {
|
||||
ensureStorageLayout();
|
||||
cleanupTemporaryFiles();
|
||||
const cleanup = () =>
|
||||
cleanupTemporaryFiles(undefined, { keep: dependencies.queue.inUsePaths() });
|
||||
cleanup();
|
||||
// Les fichiers temporaires de plus de 24 h sont supprimés pendant que le bot tourne,
|
||||
// pas seulement à son démarrage.
|
||||
const cleanupInterval = setInterval(cleanup, TEMP_CLEANUP_INTERVAL);
|
||||
cleanupInterval.unref();
|
||||
|
||||
const app = createApp(dependencies);
|
||||
const port = Number(process.env.PORT || config.webServerPort || 3000);
|
||||
|
|
@ -113,6 +121,7 @@ function startWebServer(dependencies) {
|
|||
`[${new Date().toLocaleString()}] Web control server listening on port ${port}`
|
||||
);
|
||||
});
|
||||
server.on("close", () => clearInterval(cleanupInterval));
|
||||
|
||||
return { app, server };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue