A track cut off without anyone asking (voice connection lost, bot
leaving an empty channel, restart) used to start over from the
beginning; on an hour-long mix, a drop near the end replayed it all.
- The requeued track keeps resumeAt and ffmpeg seeks to it (-ss before
-i, so it jumps there without decoding the start). It resumes 2 s
before the cut; a track cut in its first 2 s starts over.
- The player keeps playing without a connection
(NoSubscriberBehavior.Play), so the position of a voice drop is taken
when the connection drops, not 5 s later when it is given up.
- The saved queue holds the current position, and it is saved every
30 s while playing: after a crash the track resumes at most 30 s
earlier.
- Loop mode replays a resumed track from the beginning; skip and stop
are unchanged.
- The web page and /queue show "Reprise à 49:15" for such a track, and
the progress bar counts from the resume point.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Headers:
- Every JavaScript file (sources, front, scripts, tests) starts with a
/** @file … */ header, in the three levels used by sokko-g: a short
description for simple files; Utilisé par / Attention / @see for
shared modules; a full header (context, entry points, callers,
dependencies, pitfalls) for index.js, the music queue, the web
server, the storage manager and the jukebox page script.
- No @author, @version or @since: git already knows.
- test/fileHeaders.test.js fails `npm run check` when a header is
missing or a central file's header is incomplete.
Stylesheet (no visual change, checked by comparing every element's
computed styles in Chromium at 1280, 800 and 400 px, hover included):
- Role header and section comments.
- Transparent shades derive from the colour variables with
color-mix() instead of copied rgba() values; new tokens for repeated
values (text, text on accent, accent gradient, white veils, shadow).
- Native nesting for buttons, the live indicator, upload rows and
home cards; drop the unused .hero__visual--large and redundant rules.
- Utility classes move to the end so they win over components. The
library list's u-mt-1, which never applied (.list reset it), is
removed to keep the layout as it was.
Docs: CONTRIBUTING.md describes the language, header and stylesheet
conventions; CLAUDE.md points to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes:
- Update dependencies within their ranges: npm audit reported 8
vulnerabilities (proxy-addr, multer, body-parser, undici...), now 0.
- Close open connections on shutdown: an open jukebox page kept its
/api/events stream alive, so every restart waited for the 10 s
forced exit and ended with code 1.
- Restore the ANSI escape characters of the game servers message, lost
in a269824 (the status showed "[2;32mOnline[0m" as plain text). They
are now written as \u001b so they cannot silently disappear again.
- Rename MusicQueue.listeners(), which shadowed EventEmitter's own
listeners(eventName), to humanListeners().
- Deploy: check the VM's SSH host key (new DEPLOY_KNOWN_HOSTS secret)
instead of StrictHostKeyChecking=no; run checks on push only, since
PR branches are already checked by their push.
Commands:
- /listcommand is built from the loaded commands and their descriptions.
- /deletemsgs reports messages older than 14 days that it cannot delete.
- Vocal commands act on the caller's voice channel, falling back to
VOICE_CHANNEL_ID.
- /maketeam accepts comma-separated names, so names can contain spaces.
- The game servers message is edited whenever its content changes, and
a failed first update is retried instead of stopping the refresh.
Cleanup:
- Shared command loader (src/loadCommands.js); drop the unused
"[disabled]" folders mechanism and the NODE_ENV requirement.
- SHINUWA_USER_ID becomes OWNER_USER_ID (the old name still works).
- One shuffle helper instead of three copies; remove dead code
(validateAudioFile, PORT fallback, needless async).
- README: prerequisites first, consistent Node version, deploy secrets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Save the queue to storage/runtime/queue.json and restore it at startup,
the interrupted track first; playback resumes once someone is in the
voice channel. Shutdown keeps the queued files instead of deleting them.
- Shuffle the upcoming tracks; loop mode sends finished tracks back to the
end of the queue, except removed or failed ones.
- Rename library tracks (queued copies follow), enqueue the whole library,
optionally shuffled.
- Stream queue and library changes to the web page with Server-Sent Events
(GET /api/events).
- Sanitise the requester name sent when queueing a library track.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Play every track through an ffmpeg process that normalises loudness
(EBU R128) and outputs Ogg Opus, handed to Discord as is: no more Opus
encoding in JavaScript with opusscript. Measured at over 40x real time,
about 2% of a core while playing. Closing the stream kills ffmpeg.
- Encoding at upload instead was ruled out: over two minutes for an 85-minute
mix, during which the upload would hang.
- Read duration, title and artist with ffprobe at upload; default the title
to "Artist - Title" or the file name without extension.
- Fill the duration of existing library entries at startup.
- Expose the position of the current track in queue snapshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>