This PR upgrades Node.js from EOL 20/22 to 24 LTS, rewrites the Discord bot in ESM (fixing 5 bugs along the way), bumps frontend deps including TypeScript 6, and patches three Docker CVEs.
Fixed
- Discord bot files missing from build output — corrected
ToolsDirandContent Includepaths inListenarr.Api.csproj; switched toContent Remove+Content Includeso.jsfiles are copied withCopyToOutputDirectory: PreserveNewest. - Discord bot failed to start (
discord.jsnamed ESM export error) — replaced named ESM bindings with a default import + destructure pattern to correctly handlediscord.jsas a CJS module. - Discord bot
library/addblocked by antiforgery middleware —AntiforgeryValidationMiddlewarenow short-circuits when theApiKeyauth method claim is present, since CSRF does not apply to machine-to-machine callers. - Discord bot
"body used already"crash onlibrary/add(node-fetch v3) — restructured the response-reading path so the body stream is consumed exactly once. - Discord bot
library/add400 (isbntype mismatch andseries: "[]") — bot now normalizesisbnto an array and sanitizes a stringified empty-arrayseriestoundefinedbefore sending.
Changed
- Node.js upgraded from 20/22 to 24 (Active LTS) — both
buildandfinalDockerfile stages updated tosetup_24.x;enginesfield infe/package.jsonupdated to>=24.0.0. - Discord bot converted from CommonJS to ESM —
discord-bot/index.jsnow usesimport/exportsyntax;"type": "module"added todiscord-bot/package.json;__dirnamederived viafileURLToPath(import.meta.url); unlocks ESM-only bumps:node-fetch^3.3.2,fetch-cookie^3.2.0,tough-cookie^6.0.1. @microsoft/signalrupgraded from ^8 to ^10 in discord-bot.- TypeScript upgraded from ~5.9 to ~6.0 in
/fe— all TS 6 breaking changes were already addressed. - **Frontend dependency ...
Automated canary build