Make the jukebox the home page, add seeking and redesign the site
Seeking: the progress bar is now a slider. Releasing it calls POST /api/player/seek, which restarts ffmpeg at that position and swaps the audio resource without going through Idle, so the track is neither finished nor requeued in loop mode. Structure: the jukebox is served at / and the old home page is gone. /jukebox/ redirects to / with its query string, and the Discord login callback now returns to /. Redesign: a login screen until the visitor is signed in, then an app layout with a top bar, the library on the left and the player and queue on the right (sticky, two columns from 1000 px). Small screens get a mini player while the main one is out of view. Icon buttons, a single play/pause button, a drop zone for uploads, toast messages and a refined violet palette with checked contrast. A refused password now returns to the login screen instead of leaving an empty page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d14cc414b5
commit
25f22dd363
13 changed files with 1615 additions and 1051 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file Couvre la file du jukebox sans Discord : lecture, reconnexion, départ et retour du bot dans le
|
||||
* salon, reprise d'un morceau interrompu à sa position, mode boucle, mélange et reprise après
|
||||
* un redémarrage.
|
||||
* un redémarrage, déplacement dans le morceau en cours.
|
||||
*/
|
||||
|
||||
import test from "node:test";
|
||||
|
|
@ -234,6 +234,26 @@ test("an interrupted track resumes a little before where it stopped", () => {
|
|||
queue.shutdown();
|
||||
});
|
||||
|
||||
test("seeking restarts the current track at the chosen position", () => {
|
||||
const { client } = fakeClient();
|
||||
const { queue, played } = fakeQueue(client);
|
||||
assert.equal(queue.seek(30), null);
|
||||
|
||||
queue.currentTrack = { ...track("a"), duration: 200, resumeAt: 10, startedAt: "x" };
|
||||
setPlayed(queue, 0);
|
||||
assert.equal(queue.seek(95.7).position, 95_000);
|
||||
assert.equal(queue.currentTrack.resumeAt, 95);
|
||||
assert.equal(queue.currentTrack.startedAt, "x");
|
||||
assert.deepEqual(played, ["a"]);
|
||||
|
||||
// Au-delà de la fin : juste avant la fin. Au début : sans position de reprise.
|
||||
queue.seek(500);
|
||||
assert.equal(queue.currentTrack.resumeAt, 199);
|
||||
queue.seek(0);
|
||||
assert.equal("resumeAt" in queue.currentTrack, false);
|
||||
queue.shutdown();
|
||||
});
|
||||
|
||||
test("other bots do not count as listeners", () => {
|
||||
const { client, members } = fakeClient([BOT_ID, "otherbot-1"]);
|
||||
const { queue } = fakeQueue(client);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue