Rework the jukebox page: live updates, Discord login, progress, batch uploads

- Follow the queue live through /api/events (read with fetch so the key can
  be sent), reconnect with backoff and reload the state meanwhile; an
  indicator shows whether the page is live.
- Log in with Discord when enabled, the password stays available as a
  fallback; explain failed logins and expired sessions.
- Show a progress bar and durations, the queue length and total time, and a
  hint when the queue waits for listeners.
- Shuffle and loop buttons; search, rename and add the whole library,
  optionally shuffled.
- Upload several files at once with per-file progress (XMLHttpRequest), add
  a direct link, drag and drop files; allow 40 uploads per 15 minutes.
- Style password, URL and search fields, focus rings, and the phone layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-29 12:21:43 +01:00
parent 399e851178
commit 03c410973e
5 changed files with 1019 additions and 401 deletions

View file

@ -118,7 +118,8 @@ function createApp(
apiRouter.use(createJukeboxAuth({ publicUrl: oauth.publicUrl }));
apiRouter.use(
"/uploads",
apiRateLimit({ windowMs: 15 * 60_000, limit: 10 }),
// Envoi de plusieurs fichiers d'un coup : une requête par fichier.
apiRateLimit({ windowMs: 15 * 60_000, limit: 40 }),
uploadsRouter(dependencies)
);
apiRouter.use("/queue", queueRouter(dependencies));