From 3795ee06cb113243748275d6891148662e1cc69d Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 1 Dec 2026 21:05:59 +0100 Subject: [PATCH 1/7] Add file headers, tidy the stylesheet and document the conventions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CLAUDE.md | 10 + CONTRIBUTING.md | 110 ++++++++ deployCommands.js | 5 + index.js | 15 ++ public/jukebox.html | 2 +- public/scripts/common.js | 9 + public/scripts/jukebox.js | 17 ++ public/style/styles.css | 373 ++++++++++++++++------------ scripts/check-syntax.js | 5 + src/commands/game/dice.js | 5 + src/commands/game/maketeam.js | 5 + src/commands/jukebox/play.js | 5 + src/commands/jukebox/queue.js | 5 + src/commands/jukebox/skip.js | 4 + src/commands/utility/deletemsgs.js | 5 + src/commands/utility/invitation.js | 5 + src/commands/utility/listcommand.js | 5 + src/commands/utility/ping.js | 4 + src/commands/vocal/deafall.js | 5 + src/commands/vocal/muteall.js | 5 + src/commands/vocal/undeafall.js | 5 + src/commands/vocal/unmuteall.js | 5 + src/config.js | 9 + src/events/interactionCreate.js | 5 + src/events/ready.js | 5 + src/features/directMessages.js | 12 +- src/features/formatTrack.js | 7 + src/features/invitation.js | 12 +- src/features/permissions.js | 9 + src/features/showGameServers.js | 11 + src/features/utilities.js | 8 + src/loadCommands.js | 8 + src/media/downloadAudio.js | 10 + src/media/validateAudioFile.js | 10 + src/music/ingest.js | 8 + src/music/queue.js | 19 ++ src/music/queuePersistence.js | 8 + src/web/auth/session.js | 10 + src/web/middlewares/auth.js | 9 + src/web/routes/auth.js | 10 + src/web/routes/events.js | 9 + src/web/routes/library.js | 5 + src/web/routes/notifications.js | 8 + src/web/routes/player.js | 5 + src/web/routes/queue.js | 5 + src/web/routes/uploads.js | 9 + src/web/serializers.js | 7 + src/web/server.js | 17 ++ src/web/storage/libraryMetadata.js | 8 + src/web/storage/storageManager.js | 19 ++ test/audio.test.js | 5 + test/auth.test.js | 4 + test/commands.test.js | 5 + test/directMessages.test.js | 5 + test/discordAuth.test.js | 5 + test/downloadAudio.test.js | 5 + test/fileHeaders.test.js | 68 +++++ test/gameServers.test.js | 4 + test/ingest.test.js | 5 + test/invitation.test.js | 5 + test/invitationCommand.test.js | 5 + test/musicQueue.test.js | 5 + test/serializers.test.js | 4 + test/storageManager.test.js | 5 + test/webServer.test.js | 5 + 65 files changed, 843 insertions(+), 163 deletions(-) create mode 100644 CLAUDE.md create mode 100644 CONTRIBUTING.md create mode 100644 test/fileHeaders.test.js diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..6588332 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,10 @@ +# palico-bot + +Bot Discord et jukebox web autohébergé (Node.js, discord.js, Express). Voir +[README.md](README.md) pour la configuration et le déploiement. + +- Validation : `npm run check` (syntaxe et tests) avant de rendre un travail. +- Conventions (langue, en-têtes de fichiers `/** @file … */` en trois niveaux, + feuille de style) : [CONTRIBUTING.md](CONTRIBUTING.md). Un nouveau fichier + reçoit son en-tête dès sa création ; un fichier modifié dont le rôle, les + appelants ou les pièges changent voit son en-tête mis à jour. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..64e0966 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,110 @@ +# Contribuer à palico-bot + +## Validation + +```bash +npm run check +``` + +Vérifie la syntaxe de tous les fichiers JavaScript (front compris) puis lance les +tests, dont celui des en-têtes de fichiers (`test/fileHeaders.test.js`). + +## Langue + +- Code (noms de variables, fonctions, fichiers) et journaux du serveur : anglais. +- Commentaires, documentation et textes vus par les utilisateurs (Discord, page + web, erreurs de l'API) : français. + +## En-têtes de fichiers + +Chaque fichier JavaScript (sources, front, scripts et tests) commence par un +en-tête. Il s'adresse à quelqu'un qui ouvre le fichier pour la première fois : +ce que fait le fichier, pourquoi il existe et ce qu'il faut savoir avant de le +modifier. + +### Syntaxe + +- **JavaScript** : bloc JSDoc qui commence par `/**` puis ` * @file`. Le texte + de `@file` est la description ; ses lignes suivantes s'alignent sous le texte + (7 espaces après `*`). Les rubriques viennent après une ligne ` *` vide, et + leurs lignes suivantes sont décalées de 2 espaces. Une ligne vide sépare le + bloc du code. +- **CSS** : commentaire `/* … */` dont la première ligne est ` * Rôle : …`, puis + les mêmes rubriques (`Chargé par`, `Attention`). + +Pas de `@author`, `@version` ni `@since` : Git garde déjà cet historique, et ces +balises se périment. Pas de `@module` (le chemin suffit) ni de `@description` +(doublon du texte de `@file`). + +### Trois niveaux de détail + +**Fichier simple** (commande, route simple, test) : la description seule, en +une ou deux lignes. + +```js +/** + * @file Commande /skip : passe au morceau suivant du jukebox. + */ +``` + +**Fichier partagé** (module de `features/`, `media/`, authentification, +réglages) : la description, puis seulement les rubriques utiles parmi +`Utilisé par`, `Attention` et `@see`. + +```js +/** + * @file Enregistre la file du jukebox dans storage/runtime/queue.json pour la retrouver au redémarrage. + * + * Utilisé par : index.js, qui le passe à MusicQueue (option `persistence`). + * Attention : l'écriture passe par un fichier temporaire renommé, pour ne jamais laisser un JSON à + * moitié écrit ; au chargement, les morceaux dont le fichier a disparu sont ignorés. + */ +``` + +**Fichier central** (point d'entrée, file du jukebox, serveur web, stockage, +script de la page, ou tout fichier de plus de 300 lignes) : gabarit complet. + +```js +/** + * @file + * + * Contexte : + * Points d'entrée : + * Utilisé par : + * Dépend de : + * Attention : + * @see
+ */ +``` + +### Ce que vérifie le test + +`test/fileHeaders.test.js` fait échouer `npm run check` quand : + +- un fichier JavaScript ne commence pas par `/**` puis ` * @file` ; +- un fichier de sa liste `CENTRAL_FILES`, ou un fichier source de plus de + 300 lignes, n'a pas `Contexte :`, `Utilisé par :` et `@see` ; +- `public/style/styles.css` ne commence pas par son `Rôle :`. + +Un fichier qui devient central s'ajoute à `CENTRAL_FILES`. Le test ne lit que la +présence des rubriques : leur contenu reste à écrire avec soin. + +### Règles + +- Écrire l'en-tête **après avoir lu le fichier**, jamais d'après son seul nom. +- Expliquer le pourquoi et le contexte, sans paraphraser le code. +- Citer les points d'entrée, pas toutes les fonctions : une liste complète se + périme. +- Omettre une rubrique vide plutôt que d'écrire « aucun ». +- Un commentaire qui explique une déclaration précise reste au-dessus de cette + déclaration, pas dans l'en-tête. +- Mettre l'en-tête à jour quand le rôle, les appelants ou les pièges du fichier + changent. + +## Feuille de style + +`public/style/styles.css` est servie telle quelle, sans compilation (pas de +Sass). Les couleurs viennent des variables de `:root` ; leurs versions +transparentes en dérivent avec `color-mix()` au lieu d'être recopiées en +`rgba()`. Les classes utilitaires (`u-…`, `.grid`) restent en fin de fichier, +pour l'emporter sur les composants. diff --git a/deployCommands.js b/deployCommands.js index b3abaa0..1d59491 100644 --- a/deployCommands.js +++ b/deployCommands.js @@ -1,3 +1,8 @@ +/** + * @file Enregistre les commandes slash auprès de Discord pour le serveur configuré (`npm run deploy`), + * à relancer après l'ajout d'une commande ou un changement de ses options. + */ + import { REST, Routes } from "discord.js"; import { config } from "./src/config.js"; import { loadCommands } from "./src/loadCommands.js"; diff --git a/index.js b/index.js index d6a6066..023e7fc 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,18 @@ +/** + * @file Point d'entrée du bot : connecte le client Discord, branche les commandes et les événements, + * crée la file du jukebox et démarre le serveur web. + * + * Contexte : lancé par `npm start` ; un seul processus sert le bot et le site du jukebox. + * Points d'entrée : exporte `client` et `musicQueue` ; arrêt propre sur SIGTERM et SIGINT. + * Utilisé par : `npm start` (package.json). + * Dépend de : loadCommands.js, src/events/, music/queue.js, music/queuePersistence.js, web/server.js. + * Attention : + * - Les commandes trouvent la file par `interaction.client.musicQueue`. + * - À l'arrêt, les flux en direct des pages ouvertes sont coupés de force : sinon le serveur HTTP + * ne se ferme jamais. + * @see README.md#déploiement + */ + import { Client, Collection, GatewayIntentBits } from "discord.js"; import fs from "fs"; import path from "path"; diff --git a/public/jukebox.html b/public/jukebox.html index 0d12567..ac9da62 100644 --- a/public/jukebox.html +++ b/public/jukebox.html @@ -186,7 +186,7 @@ placeholder="Rechercher un morceau…" autocomplete="off" /> -
    +

      Aucun fichier permanent enregistré.

      diff --git a/public/scripts/common.js b/public/scripts/common.js index 0e2ec49..a08fe48 100644 --- a/public/scripts/common.js +++ b/public/scripts/common.js @@ -1,3 +1,12 @@ +/** + * @file Outils de la page du jukebox indépendants de son affichage : mémoire du mot de passe et du nom, + * messages d'état, échappement HTML, formats de taille, durée et date, client de l'API. + * + * Utilisé par : public/scripts/jukebox.js. + * Attention : chargé tel quel par le navigateur (module ES, sans compilation). Le texte venu de l'API + * passe par escapeHtml avant d'être inséré en HTML. + */ + const API_KEY_STORAGE_KEY = "palico-api-key"; const DISPLAY_NAME_STORAGE_KEY = "palico-display-name"; diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index 205c2d4..21190bf 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -1,3 +1,20 @@ +/** + * @file Page du jukebox : connexion (Discord ou mot de passe), lecteur, file d'attente, bibliothèque + * et ajout de morceaux. + * + * Contexte : servi tel quel au navigateur (module ES, sans compilation) ; ne parle qu'à l'API de + * src/web/. + * Points d'entrée : initialize (au chargement), connectEvents (flux en direct), refreshAll. + * Utilisé par : public/jukebox.html. + * Dépend de : common.js, et des identifiants des éléments de jukebox.html (objet `elements`). + * Attention : + * - L'état arrive par le flux /api/events ; tant qu'il est coupé, chaque action recharge tout. + * - Le flux est lu avec fetch, et non EventSource, qui ne permet pas d'envoyer la clé. + * - Connecté avec Discord, la session (cookie) remplace la clé : pas d'en-tête Authorization. + * - Tout texte venu de l'API passe par escapeHtml avant d'aller dans innerHTML. + * @see README.md#jukebox + */ + import { createApiClient, createStatusManager, diff --git a/public/style/styles.css b/public/style/styles.css index db8b803..528b1cf 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -1,20 +1,45 @@ +/* + * Rôle : feuille de style unique du site, pour la page d'accueil (index.html) et la page du jukebox + * (jukebox.html), y compris les éléments créés par public/scripts/jukebox.js. + * Chargé par : public/index.html et public/jukebox.html. + * Attention : servie telle quelle, sans compilation. Les couleurs viennent des variables de :root ; + * leurs versions transparentes en dérivent avec color-mix() au lieu d'être recopiées en rgba(). + */ + +/* ------------------------------------------------------------------------------------------------ + * Variables + */ + :root { color-scheme: dark; - --bg: #06030d; + --bg: #050109; --bg-card: rgba(22, 14, 36, 0.9); --bg-glass: rgba(42, 25, 66, 0.65); - --border: rgba(255, 255, 255, 0.08); - --accent: #b259ff; - --accent-strong: #d66bff; + --text: #f7f1ff; --muted: #cbc4d5; --muted-dark: #8c7ea7; + --accent: #b259ff; + --accent-strong: #d66bff; + --accent-gradient: linear-gradient(120deg, var(--accent), var(--accent-strong)); + /* Texte posé sur l'accent (boutons principaux). */ + --on-accent: #08010f; --danger: #ff4d6d; --success: #59ffa7; + /* Voiles blancs, du plus léger au plus marqué : fonds de champs, bordures, pastilles, boutons. */ + --surface-soft: rgba(255, 255, 255, 0.05); + --border: rgba(255, 255, 255, 0.08); + --border-strong: rgba(255, 255, 255, 0.12); + --surface-strong: rgba(255, 255, 255, 0.15); + --shadow: rgba(2, 0, 8, 0.45); --gradient: radial-gradient(circle at 20% 20%, #2d1a49, transparent 45%), radial-gradient(circle at 80% 0%, #551e8c, transparent 40%), radial-gradient(circle at 50% 80%, #150b28, transparent 30%); } +/* ------------------------------------------------------------------------------------------------ + * Base + */ + * { box-sizing: border-box; } @@ -33,7 +58,7 @@ } code { - background: rgba(255, 255, 255, 0.08); + background: var(--border); border-radius: 6px; padding: 0.1rem 0.35rem; } @@ -42,8 +67,8 @@ body { margin: 0; min-height: 100vh; font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; - background: var(--gradient), #050109; - color: #f7f1ff; + background: var(--gradient), var(--bg); + color: var(--text); } main { @@ -68,6 +93,10 @@ p { text-align: center; } +/* ------------------------------------------------------------------------------------------------ + * En-tête des pages (illustration, titre, connexion) + */ + .hero { display: flex; flex-wrap: wrap; @@ -79,33 +108,31 @@ p { margin: 0 auto; } +/* Page d'accueil : illustration plus grande. */ .hero--home { - flex-direction: row; - align-items: center; - text-align: left; gap: 2.75rem; -} -.hero--home .hero__visual img { - max-width: 320px; + & .hero__visual img { + max-width: 320px; + } } .hero__content { flex: 1; min-width: 280px; -} -.hero__content h1 { - font-size: 2.2rem; - line-height: 1.1; - margin-top: 1rem; - margin-bottom: 1rem; -} + & h1 { + font-size: 2.2rem; + line-height: 1.1; + margin-top: 1rem; + margin-bottom: 1rem; + } -.hero__content p { - color: var(--muted); - font-size: 1.05rem; - max-width: 500px; + & p { + color: var(--muted); + font-size: 1.05rem; + max-width: 500px; + } } .hero__actions { @@ -123,17 +150,13 @@ p { min-width: 200px; display: flex; justify-content: center; -} -.hero__visual img { - max-width: 200px; - width: 100%; - height: auto; - filter: drop-shadow(0 25px 45px rgba(0, 0, 0, 0.45)); -} - -.hero__visual--large img { - max-width: 270px; + & img { + max-width: 200px; + width: 100%; + height: auto; + filter: drop-shadow(0 25px 45px rgba(0, 0, 0, 0.45)); + } } .hero__auth { @@ -147,12 +170,16 @@ p { font-size: 0.9rem; padding: 0.35rem 0.85rem; border-radius: 999px; - background: rgba(255, 255, 255, 0.08); + background: var(--border); color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; } +/* ------------------------------------------------------------------------------------------------ + * Panneaux + */ + .panel { border-radius: 18px; padding: 1.75rem; @@ -162,10 +189,11 @@ p { .panel--glass { background: var(--bg-glass); - box-shadow: 0 20px 38px rgba(2, 0, 8, 0.45); + box-shadow: 0 20px 38px var(--shadow); backdrop-filter: blur(18px); } +/* Fichiers glissés au-dessus de la section d'ajout. */ .panel--dragover { border-color: var(--accent); border-style: dashed; @@ -187,12 +215,16 @@ p { .badge { padding: 0.35rem 0.9rem; - background: rgba(178, 89, 255, 0.2); + background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); border-radius: 12px; font-size: 0.85rem; } +/* ------------------------------------------------------------------------------------------------ + * Formulaires + */ + label { display: block; font-size: 0.95rem; @@ -210,8 +242,8 @@ textarea { width: 100%; padding: 0.7rem 0.9rem; border-radius: 12px; - border: 1px solid rgba(255, 255, 255, 0.12); - background: rgba(255, 255, 255, 0.05); + border: 1px solid var(--border-strong); + background: var(--surface-soft); color: #fff; font-size: 1rem; } @@ -223,8 +255,8 @@ input[type="file"] { input:focus, textarea:focus, select:focus { - outline: 2px solid rgba(178, 89, 255, 0.5); - border-color: rgba(178, 89, 255, 0.6); + outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); + border-color: color-mix(in srgb, var(--accent) 60%, transparent); } .form-checkbox { @@ -238,36 +270,53 @@ select:focus { margin-top: 0.25rem; } +/* Section repliable du mot de passe, quand la connexion avec Discord est proposée. */ +.key-login summary { + cursor: pointer; + color: var(--muted); + margin: 1rem 0 0.75rem; +} + +.form-actions { + margin-top: 1.25rem; + display: flex; + justify-content: flex-end; +} + +/* ------------------------------------------------------------------------------------------------ + * Boutons + */ + .btn { border: none; border-radius: 999px; padding: 0.65rem 1.55rem; font-weight: 600; cursor: pointer; - background: linear-gradient(120deg, var(--accent), var(--accent-strong)); - color: #08010f; + background: var(--accent-gradient); + color: var(--on-accent); transition: transform 0.15s ease, box-shadow 0.15s ease; -} -.btn:hover { - transform: translateY(-1px); - box-shadow: 0 10px 25px rgba(178, 89, 255, 0.35); -} + &:hover { + transform: translateY(-1px); + box-shadow: 0 10px 25px color-mix(in srgb, var(--accent) 35%, transparent); + } -.btn:disabled { - opacity: 0.55; - cursor: not-allowed; - box-shadow: none; - transform: none; + &:disabled { + opacity: 0.55; + cursor: not-allowed; + box-shadow: none; + transform: none; + } } .btn--secondary { - background: rgba(255, 255, 255, 0.15); + background: var(--surface-strong); color: #fff; } .btn--danger { - background: linear-gradient(120deg, #ff4d6d, #ff89a5); + background: linear-gradient(120deg, var(--danger), #ff89a5); color: #fff; } @@ -299,31 +348,30 @@ a.btn { padding: 0.6rem 0.9rem; font-size: 0.95rem; line-height: 1.2; - text-align: center; border: 1px solid #6f7bff; border-radius: 10px; background: #5865f2; box-shadow: 0 6px 16px rgba(35, 39, 96, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; - text-decoration: none; -} - -.btn.btn--discord svg { - flex: 0 0 24px; - width: 24px; - height: 24px; -} - -.btn.btn--discord:hover { - border-color: #7c86ff; - background: #4752c4; - box-shadow: 0 8px 20px rgba(35, 39, 96, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.16); + + & svg { + flex: 0 0 24px; + width: 24px; + height: 24px; + } + + &:hover { + border-color: #7c86ff; + background: #4752c4; + box-shadow: 0 8px 20px rgba(35, 39, 96, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.16); + } } +/* Bouton à bascule activé (boucle) : reprend l'aspect du bouton principal. */ .btn[aria-pressed="true"] { - background: linear-gradient(120deg, var(--accent), var(--accent-strong)); - color: #08010f; + background: var(--accent-gradient); + color: var(--on-accent); } .btn:focus-visible { @@ -337,12 +385,17 @@ a.btn { gap: 0.5rem; } -.key-login summary { - cursor: pointer; - color: var(--muted); - margin: 1rem 0 0.75rem; +.control-group { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + margin-top: 1.25rem; } +/* ------------------------------------------------------------------------------------------------ + * Lecteur : indicateur du flux en direct, morceau en cours, progression + */ + .live-indicator { display: inline-flex; align-items: center; @@ -350,23 +403,35 @@ a.btn { font-size: 0.85rem; color: var(--muted-dark); white-space: nowrap; + + &::before { + content: ""; + width: 0.55rem; + height: 0.55rem; + border-radius: 50%; + background: var(--muted-dark); + } + + &[data-live="true"] { + color: var(--success); + } + + &[data-live="true"]::before { + background: var(--success); + box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 15%, transparent); + } } -.live-indicator::before { - content: ""; - width: 0.55rem; - height: 0.55rem; - border-radius: 50%; - background: var(--muted-dark); +.player-current { + background: rgba(0, 0, 0, 0.25); + border-radius: 16px; + padding: 1.2rem; + border: 1px solid var(--border); } -.live-indicator[data-live="true"] { - color: var(--success); -} - -.live-indicator[data-live="true"]::before { - background: var(--success); - box-shadow: 0 0 0 4px rgba(89, 255, 167, 0.15); +.player-current--empty { + color: var(--muted); + text-align: center; } .progress { @@ -383,7 +448,8 @@ a.btn { .progress__bar { height: 100%; width: 0; - background: linear-gradient(120deg, var(--accent), var(--accent-strong)); + background: var(--accent-gradient); + /* La largeur est mise à jour chaque seconde : la transition rend l'avancée continue. */ transition: width 0.9s linear; } @@ -396,6 +462,10 @@ a.btn { font-variant-numeric: tabular-nums; } +/* ------------------------------------------------------------------------------------------------ + * Ajout de morceaux : envois en cours, ajout par lien + */ + .upload-list { margin-top: 1rem; } @@ -407,6 +477,19 @@ a.btn { gap: 0.75rem; padding: 0.4rem 0; font-size: 0.9rem; + + & progress { + width: 100%; + accent-color: var(--accent); + } + + &[data-state="ok"] .upload-list__state { + color: var(--success); + } + + &[data-state="error"] .upload-list__state { + color: var(--danger); + } } .upload-list__name { @@ -415,23 +498,10 @@ a.btn { white-space: nowrap; } -.upload-list__item progress { - width: 100%; - accent-color: var(--accent); -} - .upload-list__state { color: var(--muted); } -.upload-list__item[data-state="ok"] .upload-list__state { - color: var(--success); -} - -.upload-list__item[data-state="error"] .upload-list__state { - color: var(--danger); -} - .url-form { border-top: 1px solid var(--border); padding-top: 1.25rem; @@ -449,31 +519,9 @@ a.btn { margin: 0.5rem 0 0; } -.control-group { - display: flex; - flex-wrap: wrap; - gap: 0.75rem; - margin-top: 1.25rem; -} - -.grid { - display: grid; - gap: 1rem; -} - -.grid--two { - grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); -} - -.u-mt-1 { - margin-top: 1rem; -} - -.form-actions { - margin-top: 1.25rem; - display: flex; - justify-content: flex-end; -} +/* ------------------------------------------------------------------------------------------------ + * Messages d'état (voir createStatusManager dans common.js) + */ .status { padding: 0.85rem 1.25rem; @@ -484,20 +532,24 @@ a.btn { } .status--info { - background: rgba(178, 89, 255, 0.2); + background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); } .status--error { - background: rgba(255, 77, 109, 0.15); + background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); } .status--success { - background: rgba(89, 255, 167, 0.15); + background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); } +/* ------------------------------------------------------------------------------------------------ + * Listes de morceaux (file d'attente, bibliothèque) + */ + .list { list-style: none; padding: 0; @@ -505,7 +557,7 @@ a.btn { } .list--stack > li { - border-bottom: 1px solid rgba(255, 255, 255, 0.08); + border-bottom: 1px solid var(--border); } .media-item { @@ -536,17 +588,9 @@ a.btn { gap: 0.4rem; } -.player-current { - background: rgba(0, 0, 0, 0.25); - border-radius: 16px; - padding: 1.2rem; - border: 1px solid rgba(255, 255, 255, 0.08); -} - -.player-current--empty { - color: var(--muted); - text-align: center; -} +/* ------------------------------------------------------------------------------------------------ + * Page d'accueil : cartes vers les pages du site + */ .feature-grid { display: grid; @@ -563,20 +607,40 @@ a.btn { padding: 1.25rem 1.5rem; background: var(--bg-card); transition: transform 0.15s ease, box-shadow 0.15s ease; + + &:hover { + transform: translateY(-3px); + box-shadow: 0 15px 30px var(--shadow); + } + + & .pill { + margin-bottom: 0.5rem; + } } -.feature-grid__card:hover { - transform: translateY(-3px); - box-shadow: 0 15px 30px rgba(2, 0, 8, 0.45); +/* ------------------------------------------------------------------------------------------------ + * Utilitaires de mise en page + */ + +.grid { + display: grid; + gap: 1rem; } -.feature-grid__card .pill { - margin-bottom: 0.5rem; +.grid--two { + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } +.u-mt-1 { + margin-top: 1rem; +} + +/* ------------------------------------------------------------------------------------------------ + * Petits écrans + */ + @media (max-width: 900px) { - .hero, - .hero--home { + .hero { flex-direction: column; text-align: center; } @@ -596,18 +660,11 @@ a.btn { } @media (max-width: 600px) { - .btn, - input[type="text"], - input[type="file"], - select, - textarea { + .btn { width: 100%; } - .control-group { - flex-direction: column; - } - + .control-group, .url-form__row { flex-direction: column; } diff --git a/scripts/check-syntax.js b/scripts/check-syntax.js index a50c2a7..18aca76 100644 --- a/scripts/check-syntax.js +++ b/scripts/check-syntax.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie la syntaxe de tous les fichiers JavaScript avec `node --check` (`npm run check:syntax`), + * y compris les scripts du front, que les tests n'importent pas. + */ + import fs from "node:fs"; import path from "node:path"; import { spawnSync } from "node:child_process"; diff --git a/src/commands/game/dice.js b/src/commands/game/dice.js index d10e705..f1ac5a5 100644 --- a/src/commands/game/dice.js +++ b/src/commands/game/dice.js @@ -1,3 +1,8 @@ +/** + * @file Commande /dice : lance les dés un par un, avec une pause entre chacun, puis donne le total + * (ou pile et face pour un dé à deux faces). + */ + import { SlashCommandBuilder, subtext } from "discord.js"; import { setTimeout } from "node:timers/promises"; import { getRandomInt } from "../../features/utilities.js"; diff --git a/src/commands/game/maketeam.js b/src/commands/game/maketeam.js index dd98a0f..6debb58 100644 --- a/src/commands/game/maketeam.js +++ b/src/commands/game/maketeam.js @@ -1,3 +1,8 @@ +/** + * @file Commande /maketeam : répartit une liste de joueurs au hasard en équipes. Les noms sont séparés + * par des espaces, ou seulement par des virgules dès qu'il y en a une. + */ + import { MessageFlags, SlashCommandBuilder } from "discord.js"; import { shuffle } from "../../features/utilities.js"; diff --git a/src/commands/jukebox/play.js b/src/commands/jukebox/play.js index aa45584..6bb1e65 100644 --- a/src/commands/jukebox/play.js +++ b/src/commands/jukebox/play.js @@ -1,3 +1,8 @@ +/** + * @file Commande /play : ajoute à la file un fichier joint, un lien direct ou un morceau de la + * bibliothèque (avec autocomplétion), en passant par le même ajout que la page web. + */ + import { MessageFlags, SlashCommandBuilder, escapeMarkdown } from "discord.js"; import { downloadAudio } from "../../media/downloadAudio.js"; import { ingestAudioFile } from "../../music/ingest.js"; diff --git a/src/commands/jukebox/queue.js b/src/commands/jukebox/queue.js index 17f9511..031f509 100644 --- a/src/commands/jukebox/queue.js +++ b/src/commands/jukebox/queue.js @@ -1,3 +1,8 @@ +/** + * @file Commande /queue : montre, à la seule personne qui la lance, le morceau en cours et les dix + * suivants. + */ + import { MessageFlags, SlashCommandBuilder, escapeMarkdown } from "discord.js"; import { trackLabel } from "../../features/formatTrack.js"; diff --git a/src/commands/jukebox/skip.js b/src/commands/jukebox/skip.js index 9d088c2..b460b7a 100644 --- a/src/commands/jukebox/skip.js +++ b/src/commands/jukebox/skip.js @@ -1,3 +1,7 @@ +/** + * @file Commande /skip : passe au morceau suivant du jukebox. + */ + import { MessageFlags, SlashCommandBuilder, escapeMarkdown } from "discord.js"; import { trackLabel } from "../../features/formatTrack.js"; diff --git a/src/commands/utility/deletemsgs.js b/src/commands/utility/deletemsgs.js index 480d6a5..bce1251 100644 --- a/src/commands/utility/deletemsgs.js +++ b/src/commands/utility/deletemsgs.js @@ -1,3 +1,8 @@ +/** + * @file Commande /deletemsgs : supprime les 100 derniers messages du salon, sauf les messages épinglés + * et ceux de plus de 14 jours, que Discord refuse de supprimer en lot. + */ + import { MessageFlags, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/commands/utility/invitation.js b/src/commands/utility/invitation.js index 0f6758d..c8f62c0 100644 --- a/src/commands/utility/invitation.js +++ b/src/commands/utility/invitation.js @@ -1,3 +1,8 @@ +/** + * @file Commande /invitation : publie dans le salon le message d'invitation temporaire, après avoir + * vérifié le lien (option `lien` ou INVITE_LINK) et le droit du bot à y écrire. + */ + import { MessageFlags, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { config } from "../../config.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/commands/utility/listcommand.js b/src/commands/utility/listcommand.js index 9b088f7..48fd5fd 100644 --- a/src/commands/utility/listcommand.js +++ b/src/commands/utility/listcommand.js @@ -1,3 +1,8 @@ +/** + * @file Commande /listcommand : liste les commandes chargées par catégorie, avec leur description ; + * une nouvelle commande y apparaît sans rien modifier ici. + */ + import { MessageFlags, SlashCommandBuilder } from "discord.js"; // Liste construite à partir des commandes chargées : une commande ajoutée y apparaît d'office, diff --git a/src/commands/utility/ping.js b/src/commands/utility/ping.js index ef1eed2..fed5a10 100644 --- a/src/commands/utility/ping.js +++ b/src/commands/utility/ping.js @@ -1,3 +1,7 @@ +/** + * @file Commande /ping : vérifie que le bot répond. + */ + import { MessageFlags, SlashCommandBuilder } from "discord.js"; const command = { diff --git a/src/commands/vocal/deafall.js b/src/commands/vocal/deafall.js index e961671..081c0b0 100644 --- a/src/commands/vocal/deafall.js +++ b/src/commands/vocal/deafall.js @@ -1,3 +1,8 @@ +/** + * @file Commande /deafall : rend sourds tous les membres humains du salon vocal de la personne qui la + * lance (à défaut, du salon configuré). + */ + import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { changeVoiceStatus, commandVoiceChannel } from "../../features/utilities.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/commands/vocal/muteall.js b/src/commands/vocal/muteall.js index b150b1f..af9de79 100644 --- a/src/commands/vocal/muteall.js +++ b/src/commands/vocal/muteall.js @@ -1,3 +1,8 @@ +/** + * @file Commande /muteall : rend muets tous les membres humains du salon vocal de la personne qui la + * lance (à défaut, du salon configuré). + */ + import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { changeVoiceStatus, commandVoiceChannel } from "../../features/utilities.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/commands/vocal/undeafall.js b/src/commands/vocal/undeafall.js index acf1bf8..7a1cf2e 100644 --- a/src/commands/vocal/undeafall.js +++ b/src/commands/vocal/undeafall.js @@ -1,3 +1,8 @@ +/** + * @file Commande /undeafall : rend l'ouïe à tous les membres humains du salon vocal de la personne qui + * la lance (à défaut, du salon configuré). + */ + import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { changeVoiceStatus, commandVoiceChannel } from "../../features/utilities.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/commands/vocal/unmuteall.js b/src/commands/vocal/unmuteall.js index 0f42ced..a66baff 100644 --- a/src/commands/vocal/unmuteall.js +++ b/src/commands/vocal/unmuteall.js @@ -1,3 +1,8 @@ +/** + * @file Commande /unmuteall : rend la parole à tous les membres humains du salon vocal de la personne + * qui la lance (à défaut, du salon configuré). + */ + import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { changeVoiceStatus, commandVoiceChannel } from "../../features/utilities.js"; import { requirePermission } from "../../features/permissions.js"; diff --git a/src/config.js b/src/config.js index 10c7206..4f2edc1 100644 --- a/src/config.js +++ b/src/config.js @@ -1,3 +1,12 @@ +/** + * @file Lit et valide les variables d'environnement au chargement, puis expose la configuration figée. + * + * Utilisé par : la plupart des modules du bot et du serveur web, via `config`. + * Attention : une variable obligatoire manquante ou invalide fait échouer le démarrage ; les tests + * définissent donc process.env avant d'importer un module qui en dépend. + * @see README.md#configuration + */ + // OWNER_USER_ID : la personne qui gère les serveurs de jeux (mentionnée dans leur message). // Ancien nom, encore accepté : SHINUWA_USER_ID. process.env.OWNER_USER_ID ||= process.env.SHINUWA_USER_ID; diff --git a/src/events/interactionCreate.js b/src/events/interactionCreate.js index e032388..2b430a3 100644 --- a/src/events/interactionCreate.js +++ b/src/events/interactionCreate.js @@ -1,3 +1,8 @@ +/** + * @file Aiguille les commandes slash et l'autocomplétion vers leur commande, et prévient la personne + * quand une commande échoue. + */ + import { Events, MessageFlags } from "discord.js"; const ERROR_MESSAGE = "Oups, une erreur est survenue pendant la commande 😿"; diff --git a/src/events/ready.js b/src/events/ready.js index 66241c2..a1ed092 100644 --- a/src/events/ready.js +++ b/src/events/ready.js @@ -1,3 +1,8 @@ +/** + * @file Au démarrage du bot, relance la file du jukebox si quelqu'un est déjà dans le salon vocal et + * publie l'état des serveurs de jeux. + */ + import { Events } from "discord.js"; import { showGameServers } from "../features/showGameServers.js"; diff --git a/src/features/directMessages.js b/src/features/directMessages.js index ff969c9..14fcdff 100644 --- a/src/features/directMessages.js +++ b/src/features/directMessages.js @@ -1,5 +1,13 @@ -// Envoie un message privé Discord à la demande d'une application de confiance (Sokko TCG : alertes d'expédition). -// Le texte est envoyé tel quel, sans aucune mention active ; un embed et un bouton de lien peuvent l'accompagner. +/** + * @file Envoie un message privé Discord à la demande d'une application de confiance (Sokko TCG : + * alertes d'expédition), avec un embed et un bouton de lien facultatifs. + * + * Utilisé par : web/routes/notifications.js. + * Attention : le texte est envoyé tel quel, sans aucune mention active. Les erreurs attendues sont + * des DirectMessageError, dont le statut HTTP est renvoyé à l'application. + * @see README.md#messages-privés-pour-les-applications + */ + import { ButtonStyle, ComponentType } from "discord.js"; const USER_ID_PATTERN = /^\d{17,20}$/; diff --git a/src/features/formatTrack.js b/src/features/formatTrack.js index 64ff866..3d55266 100644 --- a/src/features/formatTrack.js +++ b/src/features/formatTrack.js @@ -1,3 +1,10 @@ +/** + * @file Formate un morceau pour les messages Discord : titre et durée lisible. + * + * Utilisé par : les commandes /play, /queue et /skip. + * Attention : la page web a son propre formatDuration (public/scripts/common.js). + */ + // Durée lisible : 3:07, 1:05:09. function formatDuration(seconds) { if (!Number.isFinite(seconds) || seconds < 0) return null; diff --git a/src/features/invitation.js b/src/features/invitation.js index 189da93..0e79871 100644 --- a/src/features/invitation.js +++ b/src/features/invitation.js @@ -1,5 +1,13 @@ -// Message d'invitation : le serveur n'autorise pas ses membres à créer des invitations ; un seul -// lien à adhésion temporaire est partagé par le bot. Pour garder quelqu'un, on lui donne un rôle. +/** + * @file Vérifie le lien et rédige le message d'invitation : les membres ne peuvent pas créer + * d'invitations, le bot publie un seul lien à adhésion temporaire. + * + * Utilisé par : la commande /invitation. + * Attention : une invitation permanente est refusée ; pour garder quelqu'un, on lui donne un rôle. + * Sans la permission « Gérer le serveur », le bot ne peut pas vérifier qu'elle est temporaire. + * @see README.md#invitations + */ + import { codeBlock, DiscordjsErrorCodes } from "discord.js"; const INVITE_URL_PATTERN = diff --git a/src/features/permissions.js b/src/features/permissions.js index ecdd252..f6753be 100644 --- a/src/features/permissions.js +++ b/src/features/permissions.js @@ -1,3 +1,12 @@ +/** + * @file Vérifie qu'une personne a une permission Discord avant une commande d'administration, et lui + * répond sinon. + * + * Utilisé par : /deletemsgs, /invitation et les commandes vocales. + * Attention : setDefaultMemberPermissions ne fait que masquer la commande, et les administrateurs du + * serveur peuvent changer ce réglage : cette vérification reste la vraie protection. + */ + import { MessageFlags } from "discord.js"; async function requirePermission(interaction, permission) { diff --git a/src/features/showGameServers.js b/src/features/showGameServers.js index 5a48644..276e912 100644 --- a/src/features/showGameServers.js +++ b/src/features/showGameServers.js @@ -1,3 +1,14 @@ +/** + * @file Tient à jour le message des serveurs de jeux dans le salon textuel configuré : état sondé en + * TCP ou saisi à la main, rafraîchi toutes les deux minutes. + * + * Utilisé par : events/ready.js, au démarrage. + * Attention : la liste est relue dans src/static/gameservers-list.json (absent du dépôt, modèle + * gameservers-list.example.json) à chaque rafraîchissement ; le message n'est réédité que si son + * contenu change. + * @see README.md#données-persistantes + */ + import net from "node:net"; import { config } from "../config.js"; import { getJSONData } from "./utilities.js"; diff --git a/src/features/utilities.js b/src/features/utilities.js index b28392d..97ae8e9 100644 --- a/src/features/utilities.js +++ b/src/features/utilities.js @@ -1,3 +1,11 @@ +/** + * @file Petits outils partagés : salon vocal d'une commande, membres rendus muets ou sourds en groupe, + * lecture d'un JSON, tirage au hasard et mélange. + * + * Utilisé par : les commandes vocales, /dice, /maketeam, showGameServers.js, music/queue.js et + * web/routes/library.js. + */ + import fs from "node:fs"; import { config } from "../config.js"; diff --git a/src/loadCommands.js b/src/loadCommands.js index 5af0f4b..8551f8e 100644 --- a/src/loadCommands.js +++ b/src/loadCommands.js @@ -1,3 +1,11 @@ +/** + * @file Charge les commandes slash de src/commands//*.js et leur donne leur catégorie. + * + * Utilisé par : index.js (exécution) et deployCommands.js (enregistrement auprès de Discord). + * Attention : un nouveau dossier de commandes s'ajoute à CATEGORY_LABELS pour avoir un nom lisible + * dans /listcommand. + */ + import fs from "node:fs"; import path from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; diff --git a/src/media/downloadAudio.js b/src/media/downloadAudio.js index d96d30d..c9c4d75 100644 --- a/src/media/downloadAudio.js +++ b/src/media/downloadAudio.js @@ -1,3 +1,13 @@ +/** + * @file Télécharge un fichier audio depuis un lien donné par un utilisateur, en refusant les adresses + * internes (même après une redirection) et les fichiers de plus de 150 Mo. + * + * Utilisé par : /play et l'ajout par lien de la page web (web/routes/uploads.js). + * Attention : l'adresse est vérifiée pendant la résolution DNS de la connexion elle-même + * (safeLookup), pas avant : un autre client HTTP devrait lui aussi passer par safeLookup, sinon la + * protection disparaît. + */ + import dns from "node:dns"; import fs from "node:fs"; import http from "node:http"; diff --git a/src/media/validateAudioFile.js b/src/media/validateAudioFile.js index 78d5dcc..331e8ed 100644 --- a/src/media/validateAudioFile.js +++ b/src/media/validateAudioFile.js @@ -1,3 +1,13 @@ +/** + * @file Vérifie avec ffprobe qu'un fichier est de l'audio (durée, titre, artiste), et le convertit + * avec ffmpeg en Ogg Opus au volume normalisé, prêt pour Discord. + * + * Utilisé par : music/ingest.js et storage/libraryMetadata.js (probeAudioFile), music/queue.js + * (createOpusStream). + * Attention : ffmpeg et ffprobe doivent être installés sur la machine. Fermer le flux Opus arrête + * ffmpeg. + */ + import { execFile, spawn } from "node:child_process"; import { promisify } from "node:util"; diff --git a/src/music/ingest.js b/src/music/ingest.js index 3025d7b..367587d 100644 --- a/src/music/ingest.js +++ b/src/music/ingest.js @@ -1,3 +1,11 @@ +/** + * @file Étape commune à tous les nouveaux morceaux (envoi web, lien, pièce jointe Discord) : vérifie + * que le fichier est de l'audio, l'enregistre et le met en file. + * + * Utilisé par : /play et web/routes/uploads.js. + * Attention : le fichier doit déjà être dans storage/temp ; en cas d'échec, il est supprimé. + */ + import { probeAudioFile } from "../media/validateAudioFile.js"; import { discardUploadedFile, diff --git a/src/music/queue.js b/src/music/queue.js index 811685f..1959b6f 100644 --- a/src/music/queue.js +++ b/src/music/queue.js @@ -1,3 +1,22 @@ +/** + * @file File d'attente et lecteur du jukebox : joue les morceaux dans le salon vocal configuré et + * prévient les pages web à chaque changement. + * + * Contexte : une seule instance, créée par index.js et partagée par les commandes Discord + * (client.musicQueue) et le serveur web. + * Points d'entrée : enqueue, remove, move, skip, stop, start, snapshot ; événements « queueUpdate » + * (état de la file, émis ici) et « libraryUpdate » (bibliothèque modifiée, émis par les routes). + * Utilisé par : index.js, /play, /queue, /skip, web/routes/ et music/ingest.js. + * Dépend de : @discordjs/voice, media/validateAudioFile.js (flux Opus), + * web/storage/storageManager.js (fichiers), une persistance passée au constructeur. + * Attention : + * - Sans morceau ou sans auditeur pendant 5 min, le bot quitte le salon. Parti faute d'auditeurs, + * il revient dès que quelqu'un le rejoint. + * - Un morceau temporaire est supprimé une fois joué, retiré ou en erreur, sauf en mode boucle. + * - Toute modification de la file émet « queueUpdate » : c'est aussi ce qui l'enregistre. + * @see README.md#jukebox + */ + import { EventEmitter } from "events"; import { randomUUID } from "node:crypto"; import { diff --git a/src/music/queuePersistence.js b/src/music/queuePersistence.js index 0e330d7..370f6fe 100644 --- a/src/music/queuePersistence.js +++ b/src/music/queuePersistence.js @@ -1,3 +1,11 @@ +/** + * @file Enregistre la file du jukebox dans storage/runtime/queue.json pour la retrouver au redémarrage. + * + * Utilisé par : index.js, qui le passe à MusicQueue (option `persistence`). + * Attention : l'écriture passe par un fichier temporaire renommé, pour ne jamais laisser un JSON à + * moitié écrit ; au chargement, les morceaux dont le fichier a disparu sont ignorés. + */ + import fs from "node:fs"; import path from "node:path"; diff --git a/src/web/auth/session.js b/src/web/auth/session.js index 615a853..0fe72fe 100644 --- a/src/web/auth/session.js +++ b/src/web/auth/session.js @@ -1,3 +1,13 @@ +/** + * @file Sessions de la connexion avec Discord, sans stockage côté serveur : jeton signé par HMAC dans + * un cookie, et lecture et écriture des cookies. + * + * Utilisé par : web/routes/auth.js. + * Attention : changer SESSION_SECRET déconnecte tout le monde ; une session dure 30 jours et ne peut + * pas être révoquée avant. + * @see README.md#connexion-avec-discord + */ + import { createHmac, timingSafeEqual } from "node:crypto"; const SESSION_COOKIE = "palico_session"; diff --git a/src/web/middlewares/auth.js b/src/web/middlewares/auth.js index 1e04ddb..695c286 100644 --- a/src/web/middlewares/auth.js +++ b/src/web/middlewares/auth.js @@ -1,3 +1,12 @@ +/** + * @file Contrôles d'accès des routes web : clé d'API (Bearer), clé ou session Discord pour le jukebox, + * connexions locales seulement pour les applications. + * + * Utilisé par : web/server.js. + * Attention : avec une session (cookie), une requête qui modifie quelque chose doit venir du site + * lui-même (en-tête Origin). localOnly lit l'adresse de la socket, pas req.ip. + */ + import { config } from "../../config.js"; import { createHash, timingSafeEqual } from "node:crypto"; diff --git a/src/web/routes/auth.js b/src/web/routes/auth.js index 3d09d4a..464d061 100644 --- a/src/web/routes/auth.js +++ b/src/web/routes/auth.js @@ -1,3 +1,13 @@ +/** + * @file Connexion avec Discord (OAuth2, portée « identify ») réservée aux membres du serveur, et + * lecture de la session à chaque requête. + * + * Utilisé par : web/server.js (routes /auth et sessionMiddleware). + * Attention : sans DISCORD_CLIENT_SECRET, WEB_PUBLIC_URL et SESSION_SECRET, les routes de connexion + * répondent 404 ; /auth/me répond toujours, pour que la page sache quoi proposer. + * @see README.md#connexion-avec-discord + */ + import { Router } from "express"; import { randomBytes } from "node:crypto"; import { diff --git a/src/web/routes/events.js b/src/web/routes/events.js index 4bd3fff..b35e035 100644 --- a/src/web/routes/events.js +++ b/src/web/routes/events.js @@ -1,3 +1,12 @@ +/** + * @file Flux d'événements en direct (Server-Sent Events) vers la page du jukebox : état de la file à + * chaque changement, et signal quand la bibliothèque change. + * + * Utilisé par : web/server.js (/api/events) ; lu par public/scripts/jukebox.js. + * Attention : chaque page ouverte garde une connexion ; ses écoutes sur la file sont retirées à la + * fermeture. Un commentaire envoyé toutes les 25 s empêche le proxy de couper la connexion. + */ + import { Router } from "express"; const HEARTBEAT_INTERVAL = 25_000; diff --git a/src/web/routes/library.js b/src/web/routes/library.js index 78f822a..1ad83a8 100644 --- a/src/web/routes/library.js +++ b/src/web/routes/library.js @@ -1,3 +1,8 @@ +/** + * @file Routes /api/library : liste, renomme et supprime les morceaux de la bibliothèque, et les + * ajoute à la file un par un ou tous d'un coup (mélangés ou non). + */ + import { Router } from "express"; import { createQueueTrackFromLibrary, diff --git a/src/web/routes/notifications.js b/src/web/routes/notifications.js index 6013c76..8e2c7f3 100644 --- a/src/web/routes/notifications.js +++ b/src/web/routes/notifications.js @@ -1,3 +1,11 @@ +/** + * @file Route /api/notifications/dm : envoie un message privé Discord pour une application de + * confiance (Sokko TCG) et journalise chaque demande sans son contenu. + * + * Utilisé par : web/server.js, derrière localOnly et la clé NOTIFICATIONS_API_KEY. + * @see README.md#messages-privés-pour-les-applications + */ + import { Router } from "express"; import { DirectMessageError, sendDirectMessage } from "../../features/directMessages.js"; diff --git a/src/web/routes/player.js b/src/web/routes/player.js index c00a4f1..867ac6e 100644 --- a/src/web/routes/player.js +++ b/src/web/routes/player.js @@ -1,3 +1,8 @@ +/** + * @file Routes /api/player : boutons du lecteur (lecture, pause, reprise, suivant, arrêt, mélange, + * boucle) ; chacune renvoie le nouvel état de la file. + */ + import { Router } from "express"; function playerRouter({ queue }) { diff --git a/src/web/routes/queue.js b/src/web/routes/queue.js index 0c5d6c9..ca439e0 100644 --- a/src/web/routes/queue.js +++ b/src/web/routes/queue.js @@ -1,3 +1,8 @@ +/** + * @file Routes /api/queue : état de la file, ajout d'un morceau de la bibliothèque, retrait et + * déplacement d'un morceau. + */ + import { Router } from "express"; import { createQueueTrackFromLibrary, findPermanentTrack } from "../storage/storageManager.js"; import { serializeTrack } from "../serializers.js"; diff --git a/src/web/routes/uploads.js b/src/web/routes/uploads.js index a2ee3de..27a5c18 100644 --- a/src/web/routes/uploads.js +++ b/src/web/routes/uploads.js @@ -1,3 +1,12 @@ +/** + * @file Routes /api/uploads : ajout d'un morceau par envoi de fichier ou par lien direct, mis en file + * et, si demandé, gardé dans la bibliothèque. + * + * Utilisé par : web/server.js ; appelé par les formulaires d'ajout de la page du jukebox. + * Attention : le type MIME annoncé par le navigateur n'est pas filtré ; ffprobe vérifie le contenu + * réel après l'envoi (music/ingest.js). + */ + import { Router } from "express"; import multer from "multer"; import { downloadAudio } from "../../media/downloadAudio.js"; diff --git a/src/web/serializers.js b/src/web/serializers.js index c861b8a..e2182ee 100644 --- a/src/web/serializers.js +++ b/src/web/serializers.js @@ -1,3 +1,10 @@ +/** + * @file Prépare les morceaux pour l'API : retire le chemin et le nom du fichier sur le disque. + * + * Utilisé par : music/queue.js (snapshot) et les routes web. + * Attention : tout morceau envoyé à une page ou à un client passe par ici. + */ + function serializeTrack(track) { if (!track) { return null; diff --git a/src/web/server.js b/src/web/server.js index 1828ef0..84c931c 100644 --- a/src/web/server.js +++ b/src/web/server.js @@ -1,3 +1,20 @@ +/** + * @file Serveur web du jukebox : API protégée, connexion avec Discord, flux en direct, pages statiques + * et messages privés pour les applications locales. + * + * Contexte : démarré par index.js dans le même processus que le bot, derrière Caddy en production. + * Points d'entrée : createApp (application Express seule, utilisée par les tests) et startWebServer + * (écoute, nettoyage horaire de storage/temp, complément des métadonnées de la bibliothèque). + * Utilisé par : index.js et les tests web. + * Dépend de : routes/, middlewares/auth.js, storage/. + * Attention : + * - Chaque groupe de routes a sa propre limite de requêtes ; seules les réponses 401 comptent dans + * la limite contre la force brute. + * - /api/notifications n'accepte que les connexions locales et sa propre clé, distincte de celle du + * jukebox. + * @see README.md#jukebox + */ + import express from "express"; import helmet from "helmet"; import { rateLimit } from "express-rate-limit"; diff --git a/src/web/storage/libraryMetadata.js b/src/web/storage/libraryMetadata.js index 462ca7f..74e1a59 100644 --- a/src/web/storage/libraryMetadata.js +++ b/src/web/storage/libraryMetadata.js @@ -1,3 +1,11 @@ +/** + * @file Complète au démarrage la durée et l'artiste des morceaux de la bibliothèque ajoutés avant que + * l'envoi ne les relève. + * + * Utilisé par : web/server.js (startWebServer). + * Attention : un fichier illisible est ignoré et retenté au démarrage suivant. + */ + import { probeAudioFile } from "../../media/validateAudioFile.js"; import { getPermanentLibrary, updatePermanentTracks } from "./storageManager.js"; diff --git a/src/web/storage/storageManager.js b/src/web/storage/storageManager.js index 7be5db5..ea833ed 100644 --- a/src/web/storage/storageManager.js +++ b/src/web/storage/storageManager.js @@ -1,3 +1,22 @@ +/** + * @file Stockage des fichiers audio : storage/temp pour les morceaux joués une seule fois, + * storage/permanent et sa liste storage/runtime/library.json pour la bibliothèque. + * + * Contexte : seul module qui crée, déplace ou supprime les fichiers audio et la liste de la + * bibliothèque. + * Points d'entrée : registerUploadedFile (nouveau fichier), getPermanentLibrary, + * createQueueTrackFromLibrary, cleanupTemporaryFiles, deleteTrackFile. + * Utilisé par : music/ (ajout, file), web/routes/library.js et queue.js, /play, web/server.js. + * Attention : + * - Les dossiers sont fixés au chargement d'après le répertoire de travail : le bot se lance depuis + * la racine du projet, et les tests changent de répertoire avant d'importer ce module. + * - library.json ne garde que les noms de fichiers ; le chemin complet est recalculé à la lecture, + * pour que le dossier puisse être déplacé. + * - La bibliothèque est limitée à 2 Go. Les fichiers temporaires de plus de 24 h sont supprimés, + * sauf ceux encore dans la file. + * @see README.md#données-persistantes + */ + import fs from "fs"; import path from "path"; import { randomUUID } from "node:crypto"; diff --git a/test/audio.test.js b/test/audio.test.js index 0fff37d..f0de568 100644 --- a/test/audio.test.js +++ b/test/audio.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie la lecture des tags et la conversion en Opus avec les vrais ffprobe et ffmpeg ; + * ignoré s'ils ne sont pas installés. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { spawn, spawnSync } from "node:child_process"; diff --git a/test/auth.test.js b/test/auth.test.js index c9b6722..00e9b42 100644 --- a/test/auth.test.js +++ b/test/auth.test.js @@ -1,3 +1,7 @@ +/** + * @file Vérifie que l'API du jukebox n'accepte que la clé exacte dans l'en-tête Authorization. + */ + import test from "node:test"; import assert from "node:assert/strict"; diff --git a/test/commands.test.js b/test/commands.test.js index 93d971d..92654f3 100644 --- a/test/commands.test.js +++ b/test/commands.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie que toutes les commandes se chargent, puis /listcommand, /maketeam, /queue, les + * commandes vocales et les permissions des commandes d'administration. + */ + import test from "node:test"; import assert from "node:assert/strict"; diff --git a/test/directMessages.test.js b/test/directMessages.test.js index 26a36c6..f2c1b1c 100644 --- a/test/directMessages.test.js +++ b/test/directMessages.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie l'envoi des messages privés : mentions désactivées, contrôle du texte, des embeds et + * des liens, erreurs Discord traduites en erreurs pour l'application. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { DirectMessageError, sendDirectMessage } from "../src/features/directMessages.js"; diff --git a/test/discordAuth.test.js b/test/discordAuth.test.js index 13e3014..e6bf54e 100644 --- a/test/discordAuth.test.js +++ b/test/discordAuth.test.js @@ -1,3 +1,8 @@ +/** + * @file Couvre la connexion avec Discord : membres et non-membres, état OAuth, origine des requêtes, + * jetons falsifiés ou expirés, et le mot de passe quand OAuth est désactivé. + */ + import test from "node:test"; import assert from "node:assert/strict"; diff --git a/test/downloadAudio.test.js b/test/downloadAudio.test.js index 92f9eb4..754d453 100644 --- a/test/downloadAudio.test.js +++ b/test/downloadAudio.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie le téléchargement par lien avec un serveur local : nom du fichier, adresses internes + * refusées (même après une redirection), taille maximale et protocoles acceptés. + */ + import test from "node:test"; import assert from "node:assert/strict"; import dns from "node:dns"; diff --git a/test/fileHeaders.test.js b/test/fileHeaders.test.js new file mode 100644 index 0000000..28ad36b --- /dev/null +++ b/test/fileHeaders.test.js @@ -0,0 +1,68 @@ +/** + * @file Vérifie que chaque fichier JavaScript et la feuille de style commencent par leur en-tête, et que + * les fichiers centraux ont un en-tête complet. + * + * Attention : le test ne lit que la présence des rubriques ; leur contenu reste à écrire avec soin. + * @see CONTRIBUTING.md#en-têtes-de-fichiers + */ + +import test from "node:test"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); +const JS_ROOTS = ["index.js", "deployCommands.js", "src", "public/scripts", "scripts", "test"]; +// Fichiers centraux : en-tête complet exigé. Un fichier qui le devient s'ajoute ici. +const CENTRAL_FILES = [ + "index.js", + "public/scripts/jukebox.js", + "src/music/queue.js", + "src/web/server.js", + "src/web/storage/storageManager.js", +]; +const LONG_FILE_LINES = 300; + +function collectJavaScriptFiles(entry) { + const absolutePath = path.join(ROOT, entry); + if (fs.statSync(absolutePath).isFile()) { + return entry.endsWith(".js") ? [entry] : []; + } + return fs + .readdirSync(absolutePath) + .flatMap((child) => collectJavaScriptFiles(path.posix.join(entry, child))); +} + +function header(content) { + const end = content.indexOf("*/"); + return end === -1 ? "" : content.slice(0, end); +} + +const jsFiles = JS_ROOTS.flatMap(collectJavaScriptFiles); + +test("every JavaScript file starts with a @file header", () => { + const missing = jsFiles.filter((file) => { + const content = fs.readFileSync(path.join(ROOT, file), "utf8"); + return !content.startsWith("/**\n * @file "); + }); + assert.deepEqual(missing, []); +}); + +test("central and long files have a complete header", () => { + const long = jsFiles.filter( + (file) => + !file.startsWith("test/") && + fs.readFileSync(path.join(ROOT, file), "utf8").split("\n").length > LONG_FILE_LINES + ); + const incomplete = [...new Set([...CENTRAL_FILES, ...long])].filter((file) => { + const text = header(fs.readFileSync(path.join(ROOT, file), "utf8")); + return !["Contexte :", "Utilisé par :", "@see "].every((rubric) => text.includes(rubric)); + }); + assert.deepEqual(incomplete, []); +}); + +test("the stylesheet starts with its role", () => { + const content = fs.readFileSync(path.join(ROOT, "public/style/styles.css"), "utf8"); + assert.ok(content.startsWith("/*\n * Rôle : ")); +}); diff --git a/test/gameServers.test.js b/test/gameServers.test.js index 27b0002..f09b82c 100644 --- a/test/gameServers.test.js +++ b/test/gameServers.test.js @@ -1,3 +1,7 @@ +/** + * @file Vérifie le sondage TCP des serveurs de jeux, l'état saisi à la main et le message publié. + */ + import test from "node:test"; import assert from "node:assert/strict"; import net from "node:net"; diff --git a/test/ingest.test.js b/test/ingest.test.js index 26ba4a0..878d98c 100644 --- a/test/ingest.test.js +++ b/test/ingest.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie l'ajout d'un fichier : titre par défaut, mise en file avec ses métadonnées et + * suppression d'un fichier qui n'est pas de l'audio. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { EventEmitter } from "node:events"; diff --git a/test/invitation.test.js b/test/invitation.test.js index a7aed2d..acf5244 100644 --- a/test/invitation.test.js +++ b/test/invitation.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie la lecture des liens d'invitation, le refus des invitations permanentes ou inconnues + * et les avertissements joints au message. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { DiscordjsErrorCodes } from "discord.js"; diff --git a/test/invitationCommand.test.js b/test/invitationCommand.test.js index 7eae0c9..3971c62 100644 --- a/test/invitationCommand.test.js +++ b/test/invitationCommand.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie que /invitation publie le lien vérifié, ou explique pourquoi le bot ne peut pas écrire + * dans le salon. + */ + import test from "node:test"; import assert from "node:assert/strict"; diff --git a/test/musicQueue.test.js b/test/musicQueue.test.js index 8395847..937e990 100644 --- a/test/musicQueue.test.js +++ b/test/musicQueue.test.js @@ -1,3 +1,8 @@ +/** + * @file Couvre la file du jukebox sans Discord : lecture, reconnexion, départ et retour du bot dans le + * salon, mode boucle, mélange et reprise après un redémarrage. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { EventEmitter } from "node:events"; diff --git a/test/serializers.test.js b/test/serializers.test.js index 595d8c2..8bd42af 100644 --- a/test/serializers.test.js +++ b/test/serializers.test.js @@ -1,3 +1,7 @@ +/** + * @file Vérifie que les morceaux envoyés par l'API ne montrent pas leurs chemins sur le disque. + */ + import test from "node:test"; import assert from "node:assert/strict"; import { serializeTrack, serializeTracks } from "../src/web/serializers.js"; diff --git a/test/storageManager.test.js b/test/storageManager.test.js index d628c00..07cb5e9 100644 --- a/test/storageManager.test.js +++ b/test/storageManager.test.js @@ -1,3 +1,8 @@ +/** + * @file Vérifie la bibliothèque dans un dossier temporaire : chemins portables, migration de l'ancien + * fichier et complément des durées manquantes. + */ + import test from "node:test"; import assert from "node:assert/strict"; import fs from "node:fs"; diff --git a/test/webServer.test.js b/test/webServer.test.js index d8eb218..57f64fd 100644 --- a/test/webServer.test.js +++ b/test/webServer.test.js @@ -1,3 +1,8 @@ +/** + * @file Couvre l'application web : route des messages privés (clé, limite, connexions locales), + * /readyz et flux d'événements. + */ + import test from "node:test"; import assert from "node:assert/strict"; From 11ee972636a1bb529b51df25cda87616f79c917e Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 1 Dec 2026 21:27:49 +0100 Subject: [PATCH 2/7] Add library sections and track covers Sections: - The library can be split into named, ordered sections, stored in storage/runtime/sections.json; each track keeps its sectionId. - Sections are created, renamed, reordered and deleted from the page (/api/library/sections). Deleting one keeps its tracks, without a section. - A section, or the tracks without one, can be queued in one go, shuffled or not (enqueue-all takes a sectionId). - The upload form (file or link) picks the section of a kept track. - Without any section, the library stays a plain list. Covers: - A kept track takes the cover embedded in its file (MP3, FLAC...), from the web page or /play garder:. Older tracks are looked at once on startup; a track without one keeps cover: null. - "Renommer" becomes "Modifier": a dialog to change the title, the section and the cover (upload with preview, or removal). - ffmpeg turns covers into JPEGs of at most 512 px, stored in storage/covers and deleted with their track. An uploaded image is only passed to ffmpeg after its signature is checked (PNG, JPEG, WebP, GIF), with that decoder forced, so ffmpeg never guesses the format of an unknown file. - Covers are served under /covers without authentication, since an cannot send the key; their random names are only given by the API and never change content (one-year cache). - The current track and the queue show the cover of their library track. Docs: README lists the new data to back up; storage/covers is ignored. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 1 + README.md | 11 +- public/jukebox.html | 41 +++- public/scripts/jukebox.js | 347 ++++++++++++++++++++++++++--- public/style/styles.css | 151 ++++++++++++- src/media/coverArt.js | 76 +++++++ src/music/ingest.js | 25 ++- src/web/routes/library.js | 96 ++++++-- src/web/routes/librarySections.js | 44 ++++ src/web/routes/uploads.js | 7 +- src/web/serializers.js | 8 +- src/web/server.js | 8 + src/web/storage/libraryCovers.js | 89 ++++++++ src/web/storage/libraryMetadata.js | 27 ++- src/web/storage/librarySections.js | 107 +++++++++ src/web/storage/storageManager.js | 23 +- test/coverArt.test.js | 87 ++++++++ test/libraryCovers.test.js | 118 ++++++++++ test/librarySections.test.js | 68 ++++++ 19 files changed, 1258 insertions(+), 76 deletions(-) create mode 100644 src/media/coverArt.js create mode 100644 src/web/routes/librarySections.js create mode 100644 src/web/storage/libraryCovers.js create mode 100644 src/web/storage/librarySections.js create mode 100644 test/coverArt.test.js create mode 100644 test/libraryCovers.test.js create mode 100644 test/librarySections.test.js diff --git a/.gitignore b/.gitignore index 30118f3..c91a67d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ storage/permanent/* !storage/permanent/.gitkeep storage/temp/* !storage/temp/.gitkeep +storage/covers/ # Operating system files .DS_Store diff --git a/README.md b/README.md index 1159d58..e08aa4c 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,9 @@ npm run deploy Le dossier `storage/` est une donnée applicative et ne doit pas être remplacé pendant un déploiement. Sauvegarder régulièrement : -- `storage/runtime/library.json` (et `storage/runtime/queue.json`, la file en cours) ; -- `storage/permanent/`. +- `storage/runtime/library.json`, `storage/runtime/sections.json` (sections de + la bibliothèque) et `storage/runtime/queue.json` (la file en cours) ; +- `storage/permanent/` (fichiers audio) et `storage/covers/` (pochettes). Les fichiers placés dans `storage/temp/` sont temporaires et nettoyés après 24 heures. @@ -103,6 +104,12 @@ file d'attente. (réseau local, boucle locale…), y compris après une redirection. - Chaque morceau passe par `ffmpeg`, qui normalise le volume (EBU R128) et encode en Opus : Discord reçoit l'audio sans réencodage. +- La page web range la bibliothèque en sections (chacune peut être ajoutée à + la file d'un coup, mélangée ou non) et donne une pochette à chaque morceau : + celle intégrée au fichier est reprise à l'ajout, et le bouton « Modifier » + permet d'en envoyer une autre (PNG, JPEG, WebP ou GIF), réduite en JPEG de + 512 px. Les pochettes sont servies sous `/covers/` sans authentification, + sous des noms aléatoires que seule l'API donne. - La file est enregistrée dans `storage/runtime/queue.json` : après un redémarrage, elle reprend dès que quelqu'un est dans le salon vocal. diff --git a/public/jukebox.html b/public/jukebox.html index ac9da62..e02dde6 100644 --- a/public/jukebox.html +++ b/public/jukebox.html @@ -168,11 +168,12 @@

      Bibliothèque permanente

      - Les fichiers conservés sont listés ici. Ajoute-les à la file, - renomme-les ou supprime-les. + Les fichiers conservés sont listés ici. Range-les en sections, + donne-leur une pochette, ajoute-les à la file.

      + +
      + + + + + + + + +
      + + +
      + + +
      @@ -213,6 +243,11 @@
      + +
      diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index 21190bf..5f2e46e 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -1,6 +1,6 @@ /** * @file Page du jukebox : connexion (Discord ou mot de passe), lecteur, file d'attente, bibliothèque - * et ajout de morceaux. + * (sections, pochettes) et ajout de morceaux. * * Contexte : servi tel quel au navigateur (module ES, sans compilation) ; ne parle qu'à l'API de * src/web/. @@ -12,6 +12,10 @@ * - Le flux est lu avec fetch, et non EventSource, qui ne permet pas d'envoyer la clé. * - Connecté avec Discord, la session (cookie) remplace la clé : pas d'en-tête Authorization. * - Tout texte venu de l'API passe par escapeHtml avant d'aller dans innerHTML. + * - Les morceaux de la file n'ont pas de pochette : elle est prise sur leur morceau de bibliothèque + * (libraryTrackId), d'où le nouvel affichage de la file à chaque changement de la bibliothèque. + * - L'aperçu d'une pochette choisie passe par une URL data: ; la politique de sécurité des contenus + * (helmet) refuse les URL blob:. * @see README.md#jukebox */ @@ -44,6 +48,10 @@ const state = { queue: [], current: null, library: [], + libraryById: new Map(), + sections: [], + // Sections repliées par la personne ("" : les morceaux sans section). + collapsedSections: new Set(), status: "idle", loop: false, // Position du morceau en cours (ms) au moment où l'état a été reçu. @@ -81,6 +89,7 @@ const elements = { libraryList: $("libraryList"), libraryEmpty: $("libraryEmpty"), librarySearch: $("librarySearch"), + newSectionBtn: $("newSectionBtn"), enqueueAllBtn: $("enqueueAllBtn"), enqueueAllShuffledBtn: $("enqueueAllShuffledBtn"), uploadSection: $("uploadSection"), @@ -90,6 +99,8 @@ const elements = { notesInput: $("uploadNotes"), permanentCheckbox: $("permanentFile"), enqueueCheckbox: $("enqueueFile"), + uploadSectionField: $("uploadSectionField"), + uploadSectionSelect: $("uploadSectionSelect"), uploadList: $("uploadList"), urlForm: $("urlForm"), urlInput: $("musicUrl"), @@ -97,6 +108,15 @@ const elements = { heroUploadBtn: $("heroUploadBtn"), heroQueueBtn: $("heroQueueBtn"), queueSection: $("queueSection"), + trackDialog: $("trackDialog"), + trackForm: $("trackForm"), + trackCoverPreview: $("trackCoverPreview"), + trackCoverInput: $("trackCoverInput"), + trackCoverRemoveBtn: $("trackCoverRemoveBtn"), + trackTitleInput: $("trackTitleInput"), + trackSectionSelect: $("trackSectionSelect"), + trackCancelBtn: $("trackCancelBtn"), + trackSaveBtn: $("trackSaveBtn"), }; const { setStatus, clearStatus } = createStatusManager(elements.status); @@ -137,7 +157,7 @@ async function performRefresh() { apiFetch("/library"), ]); applySnapshot(queueData); - applyLibrary(libraryData.tracks || []); + applyLibrary(libraryData); } catch (error) { handleApiError(error); } @@ -145,8 +165,7 @@ async function performRefresh() { async function refreshLibrary() { try { - const libraryData = await apiFetch("/library"); - applyLibrary(libraryData.tracks || []); + applyLibrary(await apiFetch("/library")); } catch (error) { handleApiError(error); } @@ -189,9 +208,14 @@ function applySnapshot(snapshot) { renderProgress(); } -function applyLibrary(tracks) { +function applyLibrary({ tracks = [], sections = [] }) { state.library = tracks; + state.libraryById = new Map(tracks.map((track) => [track.id, track])); + state.sections = sections; renderLibrary(); + renderSectionChoices(); + renderCurrentTrack(); + renderQueue(); } // --------------------------------------------------------------------------- @@ -284,6 +308,19 @@ async function connectEvents() { // --------------------------------------------------------------------------- // Affichage +// Pochette d'un morceau : la sienne (bibliothèque), sinon celle de son morceau de bibliothèque. +function coverUrlOf(track) { + return track.coverUrl ?? state.libraryById.get(track.libraryTrackId)?.coverUrl ?? null; +} + +// Les adresses viennent du serveur (/covers/) mais passent quand même par escapeHtml. +function coverHtml(url, modifier = "") { + const className = `cover ${modifier}`.trim(); + return url + ? `` + : ``; +} + function trackMeta(track) { const parts = []; const duration = formatDuration(track.duration); @@ -307,9 +344,12 @@ function renderCurrentTrack() { elements.currentTrack.classList.remove("player-current--empty"); elements.currentTrack.innerHTML = ` -
      ${escapeHtml(track.title || track.originalName)}
      -
      ${trackMeta(track)}
      -
      Commencé à ${formatDate(track.startedAt || track.createdAt)}
      + ${coverHtml(coverUrlOf(track), "cover--large")} +
      +
      ${escapeHtml(track.title || track.originalName)}
      +
      ${trackMeta(track)}
      +
      Commencé à ${formatDate(track.startedAt || track.createdAt)}
      +
      `; } @@ -350,6 +390,7 @@ function renderQueue() { const li = document.createElement("li"); li.className = "media-item media-item--queue"; li.innerHTML = ` + ${coverHtml(coverUrlOf(track))}
      ${index + 1}. ${escapeHtml(track.title || track.originalName)}
      ${trackMeta(track)}
      @@ -369,28 +410,114 @@ function renderQueue() { }); } +// Groupes de la bibliothèque, dans l'ordre des sections ; « Sans section » en dernier. +function libraryGroups() { + const groups = state.sections.map((section) => ({ section, tracks: [] })); + const bySection = new Map(groups.map((group) => [group.section.id, group])); + const unsorted = { section: null, tracks: [] }; + for (const track of state.library) { + (bySection.get(track.sectionId) ?? unsorted).tracks.push(track); + } + return [...groups, unsorted]; +} + function renderLibrary() { const query = elements.librarySearch.value.trim().toLowerCase(); - const tracks = state.library.filter((track) => + const matches = (track) => `${track.title || ""} ${track.originalName || ""} ${track.artist || ""}` .toLowerCase() - .includes(query) - ); + .includes(query); + const matchCount = state.library.filter(matches).length; elements.libraryList.replaceChildren(); - elements.libraryEmpty.hidden = tracks.length > 0; - elements.libraryEmpty.textContent = - state.library.length === 0 - ? "Aucun fichier permanent enregistré." - : "Aucun morceau ne correspond à la recherche."; + const isEmpty = state.library.length === 0 && state.sections.length === 0; + elements.libraryEmpty.hidden = !isEmpty && (matchCount > 0 || !query); + elements.libraryEmpty.textContent = isEmpty + ? "Aucun fichier permanent enregistré." + : "Aucun morceau ne correspond à la recherche."; elements.enqueueAllBtn.disabled = state.library.length === 0; elements.enqueueAllShuffledBtn.disabled = state.library.length === 0; - tracks.forEach((track) => { + // Sans section créée, la bibliothèque reste une simple liste. + if (state.sections.length === 0) { + elements.libraryList.append(renderTrackList(state.library.filter(matches))); + return; + } + + const groups = libraryGroups(); + groups.forEach((group, index) => { + const shown = group.tracks.filter(matches); + if (shown.length === 0 && (query || !group.section)) return; + elements.libraryList.append( + renderSection(group, shown, { + index, + last: state.sections.length - 1, + searching: Boolean(query), + }) + ); + }); +} + +function renderSection({ section, tracks }, shown, { index, last, searching }) { + const key = section?.id ?? ""; + const details = document.createElement("details"); + details.className = "library-section"; + details.open = searching || !state.collapsedSections.has(key); + details.addEventListener("toggle", () => { + if (searching) return; + if (details.open) state.collapsedSections.delete(key); + else state.collapsedSections.add(key); + }); + + const total = tracks.reduce((sum, track) => sum + (track.duration || 0), 0); + const count = searching ? `${shown.length} sur ${tracks.length}` : String(tracks.length); + const disabledIfEmpty = tracks.length === 0 ? "disabled" : ""; + details.innerHTML = ` + + ${escapeHtml(section?.name ?? "Sans section")} + + ${count} morceau(x)${total ? ` • ${formatDuration(total)}` : ""} + + +
      + + + ${ + section + ? ` + + + ` + : "" + } +
      + `; + details.querySelectorAll(".library-section__toolbar button").forEach((button) => { + button.addEventListener("click", () => + handleSectionAction(button.dataset.action, section, index, button) + ); + }); + + if (tracks.length === 0) { + const empty = document.createElement("p"); + empty.className = "hint library-section__empty"; + empty.textContent = "Aucun morceau dans cette section : choisis-la avec « Modifier » sur un morceau."; + details.append(empty); + } else { + details.append(renderTrackList(shown)); + } + return details; +} + +function renderTrackList(tracks) { + const list = document.createElement("ul"); + list.className = "list list--stack"; + for (const track of tracks) { const li = document.createElement("li"); li.className = "media-item media-item--library"; const duration = formatDuration(track.duration); li.innerHTML = ` + ${coverHtml(track.coverUrl)}
      ${escapeHtml(track.title || track.originalName)}
      @@ -399,7 +526,7 @@ function renderLibrary() {
      - +
      `; @@ -408,8 +535,23 @@ function renderLibrary() { handleLibraryAction(button.dataset.action, track, button) ); }); - elements.libraryList.appendChild(li); - }); + list.append(li); + } + return list; +} + +// Listes de sections du formulaire d'ajout et de la fenêtre de modification. +function renderSectionChoices() { + for (const select of [elements.uploadSectionSelect, elements.trackSectionSelect]) { + const selected = select.value; + select.replaceChildren(new Option("Sans section", "")); + for (const section of state.sections) { + select.append(new Option(section.name, section.id)); + } + select.value = state.sections.some((section) => section.id === selected) ? selected : ""; + } + elements.uploadSectionField.hidden = + state.sections.length === 0 || !elements.permanentCheckbox.checked; } function renderControls() { @@ -480,13 +622,9 @@ async function handleLibraryAction(action, track, button) { }) ); setStatus(`« ${track.title || track.originalName} » ajouté à la file`, "success"); - } else if (action === "rename") { - const title = prompt("Nouveau titre", track.title || track.originalName); - if (!title || !title.trim()) return; - await withBusyButton(button, () => - apiFetch(`/library/${track.id}`, { method: "PATCH", body: { title: title.trim() } }) - ); - if (!state.live) await refreshLibrary(); + } else if (action === "edit") { + openTrackEditor(track); + return; } else if (action === "delete") { if (!confirm(`Supprimer « ${track.title || track.originalName} » de la bibliothèque ?`)) { return; @@ -502,12 +640,13 @@ async function handleLibraryAction(action, track, button) { } } -async function enqueueAll(shuffle, button) { +// sectionId : undefined pour toute la bibliothèque, null pour les morceaux sans section. +async function enqueueAll(shuffle, button, sectionId) { try { const { tracks } = await withBusyButton(button, () => apiFetch("/library/enqueue-all", { method: "POST", - body: { shuffle, requestedBy: requesterName() }, + body: { shuffle, sectionId, requestedBy: requesterName() }, }) ); setStatus(`${tracks.length} morceau(x) ajouté(s) à la file`, "success"); @@ -517,8 +656,143 @@ async function enqueueAll(shuffle, button) { } } +async function createSection(button) { + const name = prompt("Nom de la nouvelle section"); + if (!name || !name.trim()) return; + try { + await withBusyButton(button, () => + apiFetch("/library/sections", { method: "POST", body: { name: name.trim() } }) + ); + if (!state.live) await refreshLibrary(); + } catch (error) { + setStatus(`Création de la section impossible : ${error.message}`, "error"); + } +} + +// section vaut null pour le groupe « Sans section », qui n'a que les actions d'ajout. +async function handleSectionAction(action, section, index, button) { + try { + if (action === "enqueue" || action === "shuffle") { + await enqueueAll(action === "shuffle", button, section?.id ?? null); + return; + } + if (action === "rename") { + const name = prompt("Nouveau nom de la section", section.name); + if (!name || !name.trim()) return; + await withBusyButton(button, () => + apiFetch(`/library/sections/${section.id}`, { + method: "PATCH", + body: { name: name.trim() }, + }) + ); + } else if (action === "up" || action === "down") { + const position = index + (action === "up" ? -1 : 1); + await withBusyButton(button, () => + apiFetch(`/library/sections/${section.id}`, { method: "PATCH", body: { position } }) + ); + } else if (action === "delete") { + if ( + !confirm( + `Supprimer la section « ${section.name} » ? Ses morceaux restent dans la bibliothèque, sans section.` + ) + ) { + return; + } + await withBusyButton(button, () => + apiFetch(`/library/sections/${section.id}`, { method: "DELETE" }) + ); + } + if (!state.live) await refreshLibrary(); + } catch (error) { + setStatus(`Action sur la section impossible : ${error.message}`, "error"); + } +} + +// --------------------------------------------------------------------------- +// Fenêtre de modification d'un morceau (titre, section, pochette) + +const MAX_COVER_SIZE = 10 * 1024 * 1024; +let editedTrack = null; +let removeCover = false; + +function showCoverPreview(url) { + const preview = elements.trackCoverPreview; + preview.classList.toggle("cover--empty", !url); + preview.style.backgroundImage = url ? `url("${url}")` : ""; +} + +function openTrackEditor(track) { + editedTrack = track; + removeCover = false; + elements.trackTitleInput.value = track.title || track.originalName; + renderSectionChoices(); + elements.trackSectionSelect.value = track.sectionId ?? ""; + elements.trackCoverInput.value = ""; + elements.trackCoverRemoveBtn.hidden = !track.coverUrl; + showCoverPreview(track.coverUrl); + elements.trackDialog.showModal(); +} + +function previewChosenCover() { + const file = elements.trackCoverInput.files[0]; + if (!file) { + showCoverPreview(removeCover ? null : editedTrack?.coverUrl); + return; + } + if (file.size > MAX_COVER_SIZE) { + setStatus("Image trop lourde : 10 Mo au plus", "error"); + elements.trackCoverInput.value = ""; + return; + } + const reader = new FileReader(); + reader.addEventListener("load", () => showCoverPreview(reader.result)); + reader.readAsDataURL(file); + elements.trackCoverRemoveBtn.hidden = false; +} + +function clearChosenCover() { + removeCover = true; + elements.trackCoverInput.value = ""; + elements.trackCoverRemoveBtn.hidden = true; + showCoverPreview(null); +} + +async function saveTrackEditor(event) { + event.preventDefault(); + const track = editedTrack; + if (!track) return; + + const changes = {}; + const title = elements.trackTitleInput.value.trim(); + if (title && title !== (track.title || track.originalName)) changes.title = title; + const sectionId = elements.trackSectionSelect.value || null; + if (sectionId !== (track.sectionId ?? null)) changes.sectionId = sectionId; + const coverFile = elements.trackCoverInput.files[0]; + + try { + await withBusyButton(elements.trackSaveBtn, async () => { + if (Object.keys(changes).length > 0) { + await apiFetch(`/library/${track.id}`, { method: "PATCH", body: changes }); + } + if (coverFile) { + const data = new FormData(); + data.append("cover", coverFile); + await apiFetch(`/library/${track.id}/cover`, { method: "PUT", body: data }); + } else if (removeCover && track.coverUrl) { + await apiFetch(`/library/${track.id}/cover`, { method: "DELETE" }); + } + }); + elements.trackDialog.close(); + if (!state.live) await refreshLibrary(); + } catch (error) { + // La fenêtre reste ouverte : la personne peut corriger (autre image…) et réessayer. + setStatus(`Modification impossible : ${error.message}`, "error"); + if (!state.live) await refreshLibrary(); + } +} + // Envoi avec XMLHttpRequest : contrairement à fetch, il indique la progression de l'envoi. -function uploadFile(file, { permanent, enqueue, title, onProgress }) { +function uploadFile(file, { permanent, enqueue, section, title, onProgress }) { return new Promise((resolve, reject) => { const data = new FormData(); data.append("file", file); @@ -526,6 +800,7 @@ function uploadFile(file, { permanent, enqueue, title, onProgress }) { data.append("enqueue", String(enqueue)); data.append("uploader", requesterName()); if (title) data.append("notes", title); + if (permanent && section) data.append("section", section); const request = new XMLHttpRequest(); request.open("POST", "/api/uploads"); @@ -584,6 +859,7 @@ async function handleUpload(event) { const options = { permanent: elements.permanentCheckbox.checked, enqueue: elements.enqueueCheckbox.checked, + section: elements.uploadSectionSelect.value, }; if (!options.permanent && !options.enqueue) { setStatus("Un fichier temporaire doit être ajouté à la file d'attente", "error"); @@ -638,6 +914,7 @@ async function handleUrlSubmit(event) { url, permanent: elements.permanentCheckbox.checked, enqueue: elements.enqueueCheckbox.checked, + section: elements.uploadSectionSelect.value || undefined, uploader: requesterName(), }, }) @@ -737,6 +1014,16 @@ function bindEvents() { }); elements.librarySearch.addEventListener("input", renderLibrary); + elements.newSectionBtn.addEventListener("click", () => createSection(elements.newSectionBtn)); + elements.permanentCheckbox.addEventListener("change", renderSectionChoices); + + elements.trackForm.addEventListener("submit", saveTrackEditor); + elements.trackCancelBtn.addEventListener("click", () => elements.trackDialog.close()); + elements.trackCoverInput.addEventListener("change", previewChosenCover); + elements.trackCoverRemoveBtn.addEventListener("click", clearChosenCover); + elements.trackDialog.addEventListener("close", () => { + editedTrack = null; + }); elements.enqueueAllBtn.addEventListener("click", () => enqueueAll(false, elements.enqueueAllBtn) ); diff --git a/public/style/styles.css b/public/style/styles.css index 528b1cf..f6a0a8a 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -434,6 +434,12 @@ a.btn { text-align: center; } +.player-current:not(.player-current--empty) { + display: flex; + align-items: center; + gap: 1.1rem; +} + .progress { margin-top: 0.9rem; } @@ -588,6 +594,131 @@ a.btn { gap: 0.4rem; } +/* Pochette d'un morceau : , ou
      vide (note de musique) ou à image de fond (aperçu). */ +.cover { + flex-shrink: 0; + width: 48px; + height: 48px; + border-radius: 10px; + object-fit: cover; + background: var(--surface-soft) center / cover no-repeat; + border: 1px solid var(--border); +} + +.cover--large { + width: 96px; + height: 96px; + border-radius: 14px; +} + +.cover--empty { + display: grid; + place-items: center; + color: var(--muted-dark); + + &::after { + content: "♪"; + font-size: 1.4rem; + } + + &.cover--large::after { + font-size: 2.4rem; + } +} + +/* ------------------------------------------------------------------------------------------------ + * Bibliothèque : sections repliables et fenêtre de modification d'un morceau + */ + +.library { + margin-top: 1rem; +} + +.library-section { + border: 1px solid var(--border); + border-radius: 14px; + padding: 0 1rem; + margin-bottom: 0.75rem; + background: var(--surface-soft); + + & .list--stack > li:last-child { + border-bottom: none; + } +} + +.library-section__summary { + display: flex; + align-items: baseline; + flex-wrap: wrap; + gap: 0.25rem 0.75rem; + padding: 0.85rem 0; + cursor: pointer; + list-style: none; + + &::-webkit-details-marker { + display: none; + } + + &::before { + content: "▸"; + color: var(--accent); + transition: transform 0.15s ease; + } + + [open] > &::before { + transform: rotate(90deg); + } +} + +.library-section__name { + font-weight: 600; + font-size: 1.05rem; +} + +.library-section__count { + color: var(--muted); + font-size: 0.9rem; +} + +.library-section__toolbar { + padding-bottom: 0.5rem; + border-bottom: 1px solid var(--border); +} + +.library-section__empty { + padding: 0.75rem 0 1rem; +} + +.dialog { + width: min(520px, calc(100% - 2rem)); + padding: 1.75rem; + border-radius: 18px; + border: 1px solid var(--border-strong); + background: var(--bg-card); + color: var(--text); + box-shadow: 0 20px 38px var(--shadow); + + &::backdrop { + background: color-mix(in srgb, var(--bg) 70%, transparent); + backdrop-filter: blur(4px); + } + + & h2 { + margin-bottom: 1.25rem; + } +} + +.track-editor { + display: flex; + gap: 1rem; + align-items: flex-start; +} + +.track-editor__cover-fields { + flex: 1; + min-width: 0; +} + /* ------------------------------------------------------------------------------------------------ * Page d'accueil : cartes vers les pages du site */ @@ -674,12 +805,26 @@ a.btn { gap: 0.25rem; } + /* Pochette et titre côte à côte, boutons en dessous sur toute la largeur. */ .media-item { - flex-direction: column; - align-items: stretch; + flex-wrap: wrap; } - .media-item__actions .btn { + .media-item__info { + flex: 1 1 0; + min-width: 0; + } + + .media-item__actions { + flex-basis: 100%; + } + + .track-editor { + flex-direction: column; + } + + .media-item__actions .btn, + .library-section__toolbar .btn { width: auto; flex: 1; } diff --git a/src/media/coverArt.js b/src/media/coverArt.js new file mode 100644 index 0000000..e24a965 --- /dev/null +++ b/src/media/coverArt.js @@ -0,0 +1,76 @@ +/** + * @file Fabrique les pochettes des morceaux avec ffmpeg : une image envoyée, ou la pochette intégrée + * à un fichier audio, devient un JPEG d'au plus 512 px de côté. + * + * Utilisé par : web/storage/libraryCovers.js. + * Attention : une image envoyée n'est passée à ffmpeg qu'après lecture de sa signature (PNG, JPEG, + * WebP ou GIF), avec le décodeur de ce format imposé : ffmpeg ne doit jamais deviner le format + * d'un fichier inconnu (une liste de lecture HLS pourrait lui faire lire des fichiers locaux). Le + * réencodage retire aussi les métadonnées de l'image d'origine. + */ + +import { execFile } from "node:child_process"; +import fs from "node:fs/promises"; +import { promisify } from "node:util"; + +const execFileAsync = promisify(execFile); +const COVER_SIZE = 512; + +// Signature de début de fichier → décodeur ffmpeg à imposer. +const IMAGE_FORMATS = [ + { demuxer: "png_pipe", matches: (bytes) => bytes.subarray(0, 8).equals(Buffer.from("\x89PNG\r\n\x1a\n", "latin1")) }, + { demuxer: "jpeg_pipe", matches: (bytes) => bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff }, + { demuxer: "gif", matches: (bytes) => /^GIF8[79]a$/.test(bytes.toString("latin1", 0, 6)) }, + { + demuxer: "webp_pipe", + matches: (bytes) => + bytes.toString("latin1", 0, 4) === "RIFF" && bytes.toString("latin1", 8, 12) === "WEBP", + }, +]; + +// Décodeur ffmpeg correspondant à l'image, ou null si ce n'est pas un format accepté. +async function detectImageFormat(filePath) { + const handle = await fs.open(filePath, "r"); + try { + const bytes = Buffer.alloc(12); + const { bytesRead } = await handle.read(bytes, 0, bytes.length, 0); + if (bytesRead < bytes.length) return null; + return IMAGE_FORMATS.find((format) => format.matches(bytes))?.demuxer ?? null; + } finally { + await handle.close(); + } +} + +// Écrit en JPEG la première image de inputPath (image seule, ou pochette d'un fichier audio). +// Échoue si le fichier n'en contient pas. inputFormat impose le décodeur ffmpeg. +async function createCoverImage(inputPath, outputPath, { inputFormat, run = execFileAsync } = {}) { + await run( + "ffmpeg", + [ + "-hide_banner", + "-loglevel", + "error", + ...(inputFormat ? ["-f", inputFormat] : []), + "-i", + inputPath, + "-map", + "0:v:0", + "-frames:v", + "1", + "-vf", + // Réduit à COVER_SIZE au plus, sans agrandir une image plus petite. + `scale='min(${COVER_SIZE},iw)':'min(${COVER_SIZE},ih)':force_original_aspect_ratio=decrease`, + "-c:v", + "mjpeg", + "-q:v", + "3", + "-f", + "image2", + "-y", + outputPath, + ], + { timeout: 15_000, maxBuffer: 1024 * 1024 } + ); +} + +export { createCoverImage, detectImageFormat }; diff --git a/src/music/ingest.js b/src/music/ingest.js index 367587d..41e9f7d 100644 --- a/src/music/ingest.js +++ b/src/music/ingest.js @@ -1,12 +1,15 @@ /** * @file Étape commune à tous les nouveaux morceaux (envoi web, lien, pièce jointe Discord) : vérifie - * que le fichier est de l'audio, l'enregistre et le met en file. + * que le fichier est de l'audio, l'enregistre, le met en file et, s'il rejoint la + * bibliothèque, reprend sa pochette intégrée. * * Utilisé par : /play et web/routes/uploads.js. - * Attention : le fichier doit déjà être dans storage/temp ; en cas d'échec, il est supprimé. + * Attention : le fichier doit déjà être dans storage/temp ; en cas d'échec, il est supprimé. La + * pochette est cherchée après la mise en file, pour ne pas retarder la lecture. */ import { probeAudioFile } from "../media/validateAudioFile.js"; +import { fillEmbeddedCover } from "../web/storage/libraryCovers.js"; import { discardUploadedFile, registerUploadedFile, @@ -33,9 +36,10 @@ function defaultTitle({ title, artist }, originalName) { // En cas d'échec, le fichier est supprimé. async function ingestAudioFile( file, - { permanent = false, enqueue = true, uploader, title } = {}, - { queue, probe = probeAudioFile } + { permanent = false, enqueue = true, uploader, title, sectionId = null } = {}, + { queue, probe = probeAudioFile, createCover } ) { + let track; try { if (!permanent && !enqueue) { const error = new Error("Un fichier temporaire doit être ajouté à la file d'attente"); @@ -44,25 +48,28 @@ async function ingestAudioFile( } const metadata = await probe(file.path); - const track = registerUploadedFile(file, { + track = registerUploadedFile(file, { permanent, uploader: cleanText(uploader, 80) || "inconnu", title: cleanText(title, 200) || defaultTitle(metadata, file.originalname), duration: metadata.duration, artist: metadata.artist, + sectionId, }); - if (permanent) { - queue.emit("libraryUpdate"); - } if (enqueue) { queue.enqueue(track); } - return track; } catch (error) { discardUploadedFile(file); throw error; } + + if (permanent) { + await fillEmbeddedCover(track.libraryTrackId, track.path, { create: createCover }); + queue.emit("libraryUpdate"); + } + return track; } export { defaultTitle, ingestAudioFile }; diff --git a/src/web/routes/library.js b/src/web/routes/library.js index 1ad83a8..bb00b72 100644 --- a/src/web/routes/library.js +++ b/src/web/routes/library.js @@ -1,24 +1,47 @@ /** - * @file Routes /api/library : liste, renomme et supprime les morceaux de la bibliothèque, et les - * ajoute à la file un par un ou tous d'un coup (mélangés ou non). + * @file Routes /api/library : liste la bibliothèque et ses sections, modifie un morceau (titre, + * section, pochette), le supprime, et ajoute à la file un morceau, une section ou tout. + * + * Utilisé par : web/server.js ; appelé par la page du jukebox. + * Attention : chaque changement émet « libraryUpdate » sur la file, que le flux /api/events relaie + * aux pages ouvertes. */ import { Router } from "express"; +import multer from "multer"; +import { saveCoverFromImage, setTrackCover } from "../storage/libraryCovers.js"; +import { findSection, getSections } from "../storage/librarySections.js"; import { createQueueTrackFromLibrary, deletePermanentTrack, + discardUploadedFile, findPermanentTrack, getPermanentLibrary, + TEMP_DIR, updatePermanentTracks, } from "../storage/storageManager.js"; import { serializeTrack, serializeTracks } from "../serializers.js"; import { shuffle } from "../../features/utilities.js"; +import { librarySectionsRouter } from "./librarySections.js"; + +const coverUpload = multer({ + dest: TEMP_DIR, + limits: { fileSize: 10 * 1024 * 1024, files: 1, fields: 0 }, +}); + +function cleanTitle(value) { + return String(value ?? "") + .replace(/[\u0000-\u001f]/g, "") + .trim() + .slice(0, 200); +} function libraryRouter({ queue }) { const router = Router(); + router.use("/sections", librarySectionsRouter({ queue })); router.get("/", (req, res) => { - res.json({ tracks: serializeTracks(getPermanentLibrary()) }); + res.json({ tracks: serializeTracks(getPermanentLibrary()), sections: getSections() }); }); router.delete("/:libraryId", (req, res) => { @@ -33,28 +56,75 @@ function libraryRouter({ queue }) { res.json({ removed: serializeTrack(track) }); }); + // Corps : title et/ou sectionId (null : sans section). router.patch("/:libraryId", (req, res) => { - const title = String(req.body?.title ?? "") - .replace(/[\u0000-\u001f]/g, "") - .trim() - .slice(0, 200); - if (!title) { - return res.status(400).json({ error: "Titre manquant" }); + const fields = {}; + if (req.body?.title !== undefined) { + fields.title = cleanTitle(req.body.title); + if (!fields.title) { + return res.status(400).json({ error: "Titre manquant" }); + } + } + if (req.body?.sectionId !== undefined) { + const { sectionId } = req.body; + if (sectionId !== null && !findSection(sectionId)) { + return res.status(400).json({ error: "Section introuvable" }); + } + fields.sectionId = sectionId; + } + if (Object.keys(fields).length === 0) { + return res.status(400).json({ error: "Rien à modifier" }); } - const [track] = updatePermanentTracks(new Map([[req.params.libraryId, { title }]])); + const [track] = updatePermanentTracks(new Map([[req.params.libraryId, fields]])); if (!track) { return res.status(404).json({ error: "Fichier permanent introuvable" }); } - queue.renameLibraryTrack(track.id, title); + if (fields.title) { + queue.renameLibraryTrack(track.id, fields.title); + } queue.emit("libraryUpdate"); res.json({ track: serializeTrack(track) }); }); - // Ajoute toute la bibliothèque à la file, mélangée si shuffle vaut true. + // Remplace la pochette par l'image envoyée (champ « cover »). + router.put("/:libraryId/cover", coverUpload.single("cover"), async (req, res) => { + if (!req.file) { + return res.status(400).json({ error: "Aucune image reçue" }); + } + try { + if (!findPermanentTrack(req.params.libraryId)) { + return res.status(404).json({ error: "Fichier permanent introuvable" }); + } + const cover = await saveCoverFromImage(req.file.path); + const track = setTrackCover(req.params.libraryId, cover); + if (!track) { + return res.status(404).json({ error: "Fichier permanent introuvable" }); + } + queue.emit("libraryUpdate"); + res.json({ track: serializeTrack(track) }); + } finally { + discardUploadedFile(req.file); + } + }); + + router.delete("/:libraryId/cover", (req, res) => { + const track = setTrackCover(req.params.libraryId, null); + if (!track) { + return res.status(404).json({ error: "Fichier permanent introuvable" }); + } + queue.emit("libraryUpdate"); + res.json({ track: serializeTrack(track) }); + }); + + // Ajoute la bibliothèque à la file, mélangée si shuffle vaut true. Avec sectionId, seulement + // cette section (null : les morceaux sans section). router.post("/enqueue-all", (req, res) => { - const entries = getPermanentLibrary(); + let entries = getPermanentLibrary(); + if (req.body?.sectionId !== undefined) { + entries = entries.filter((entry) => (entry.sectionId ?? null) === req.body.sectionId); + } if (req.body?.shuffle === true) { shuffle(entries); } diff --git a/src/web/routes/librarySections.js b/src/web/routes/librarySections.js new file mode 100644 index 0000000..a604c74 --- /dev/null +++ b/src/web/routes/librarySections.js @@ -0,0 +1,44 @@ +/** + * @file Routes /api/library/sections : crée, renomme, déplace et supprime les sections de la + * bibliothèque. + */ + +import { Router } from "express"; +import { createSection, deleteSection, updateSection } from "../storage/librarySections.js"; + +function librarySectionsRouter({ queue }) { + const router = Router(); + + router.post("/", (req, res) => { + const section = createSection(req.body?.name); + queue.emit("libraryUpdate"); + res.status(201).json({ section }); + }); + + // Corps : name (nouveau nom) et/ou position (nouvel emplacement, 0 en tête). + router.patch("/:sectionId", (req, res) => { + const { name, position } = req.body ?? {}; + if (name === undefined && position === undefined) { + return res.status(400).json({ error: "Rien à modifier" }); + } + const section = updateSection(req.params.sectionId, { name, position }); + if (!section) { + return res.status(404).json({ error: "Section introuvable" }); + } + queue.emit("libraryUpdate"); + res.json({ section }); + }); + + router.delete("/:sectionId", (req, res) => { + const section = deleteSection(req.params.sectionId); + if (!section) { + return res.status(404).json({ error: "Section introuvable" }); + } + queue.emit("libraryUpdate"); + res.json({ removed: section }); + }); + + return router; +} + +export { librarySectionsRouter }; diff --git a/src/web/routes/uploads.js b/src/web/routes/uploads.js index 27a5c18..ed08fdd 100644 --- a/src/web/routes/uploads.js +++ b/src/web/routes/uploads.js @@ -1,6 +1,6 @@ /** * @file Routes /api/uploads : ajout d'un morceau par envoi de fichier ou par lien direct, mis en file - * et, si demandé, gardé dans la bibliothèque. + * et, si demandé, gardé dans la bibliothèque (dans la section choisie). * * Utilisé par : web/server.js ; appelé par les formulaires d'ajout de la page du jukebox. * Attention : le type MIME annoncé par le navigateur n'est pas filtré ; ffprobe vérifie le contenu @@ -12,6 +12,7 @@ import multer from "multer"; import { downloadAudio } from "../../media/downloadAudio.js"; import { ingestAudioFile } from "../../music/ingest.js"; import { serializeTrack } from "../serializers.js"; +import { findSection } from "../storage/librarySections.js"; import { TEMP_DIR } from "../storage/storageManager.js"; // Pas de filtre sur le type MIME : il vient du navigateur et varie selon le système (un MP3 @@ -21,7 +22,7 @@ const upload = multer({ dest: TEMP_DIR, limits: { fileSize: 150 * 1024 * 1024, - fields: 4, + fields: 5, fieldSize: 512, }, fileFilter: (_req, file, callback) => { @@ -44,6 +45,8 @@ function uploadsRouter({ queue }) { enqueue: body?.enqueue !== "false" && body?.enqueue !== false, uploader: user?.name || body?.uploader || "web-ui", title: body?.notes, + // Section inconnue (supprimée entre-temps) : le morceau est rangé sans section. + sectionId: findSection(body?.section)?.id ?? null, }); router.post("/", upload.single("file"), async (req, res, next) => { diff --git a/src/web/serializers.js b/src/web/serializers.js index e2182ee..578a18e 100644 --- a/src/web/serializers.js +++ b/src/web/serializers.js @@ -1,5 +1,6 @@ /** - * @file Prépare les morceaux pour l'API : retire le chemin et le nom du fichier sur le disque. + * @file Prépare les morceaux pour l'API : retire le chemin et le nom du fichier sur le disque, et + * remplace le nom de la pochette par son adresse. * * Utilisé par : music/queue.js (snapshot) et les routes web. * Attention : tout morceau envoyé à une page ou à un client passe par ici. @@ -10,7 +11,10 @@ function serializeTrack(track) { return null; } - const { path: _path, storedName: _storedName, ...publicTrack } = track; + const { path: _path, storedName: _storedName, cover, ...publicTrack } = track; + if (cover) { + publicTrack.coverUrl = `/covers/${encodeURIComponent(cover)}`; + } return publicTrack; } diff --git a/src/web/server.js b/src/web/server.js index 84c931c..4a3c022 100644 --- a/src/web/server.js +++ b/src/web/server.js @@ -12,6 +12,9 @@ * la limite contre la force brute. * - /api/notifications n'accepte que les connexions locales et sa propre clé, distincte de celle du * jukebox. + * - Les pochettes (/covers) sont servies sans authentification : une balise n'envoie pas la + * clé. Leurs noms aléatoires ne sont donnés que par l'API, et un nom ne change jamais de + * contenu (cache d'un an). * @see README.md#jukebox */ @@ -36,6 +39,7 @@ import { uploadsRouter } from "./routes/uploads.js"; import { backfillLibraryMetadata } from "./storage/libraryMetadata.js"; import { cleanupTemporaryFiles, + COVERS_DIR, ensureStorageLayout, } from "./storage/storageManager.js"; @@ -145,6 +149,10 @@ function createApp( apiRouter.use("/events", eventsRouter(dependencies)); app.use("/api", apiRouter); + app.use( + "/covers", + express.static(COVERS_DIR, { immutable: true, maxAge: "365d", index: false, redirect: false }) + ); app.get(["/jukebox", "/jukebox/"], (_req, res) => res.sendFile(path.join(PUBLIC_DIR, "jukebox.html")) ); diff --git a/src/web/storage/libraryCovers.js b/src/web/storage/libraryCovers.js new file mode 100644 index 0000000..ffd6ad5 --- /dev/null +++ b/src/web/storage/libraryCovers.js @@ -0,0 +1,89 @@ +/** + * @file Pochettes des morceaux de la bibliothèque : reprise de la pochette intégrée au fichier audio, + * remplacement par une image envoyée depuis la page, retrait. + * + * Utilisé par : music/ingest.js (nouveau morceau), storage/libraryMetadata.js (morceaux plus + * anciens), web/routes/library.js (envoi et retrait depuis la page). + * Attention : + * - Le champ `cover` d'une entrée vaut le nom du fichier dans storage/covers, null si le morceau + * n'a pas de pochette, et il est absent tant que la pochette intégrée n'a pas été cherchée. + * - Chaque pochette reçoit un nouveau nom aléatoire et l'ancienne est supprimée : le navigateur + * peut garder une pochette en cache indéfiniment (servie sous /covers par web/server.js). + */ + +import path from "node:path"; +import { randomUUID } from "node:crypto"; +import { createCoverImage, detectImageFormat } from "../../media/coverArt.js"; +import { + COVERS_DIR, + deleteCoverFile, + findPermanentTrack, + updatePermanentTracks, +} from "./storageManager.js"; + +function httpError(status, message, cause) { + return Object.assign(new Error(message, { cause }), { status }); +} + +// create : remplace createCoverImage (tests). +async function writeCover(inputPath, { create = createCoverImage, inputFormat } = {}) { + const name = `${randomUUID()}.jpg`; + try { + await create(inputPath, path.join(COVERS_DIR, name), { inputFormat }); + return name; + } catch (error) { + deleteCoverFile(name); + throw error; + } +} + +// Pochette intégrée au fichier audio, ou null s'il n'en a pas (ou si ffmpeg ne la lit pas). +async function saveCoverFromAudio(audioPath, options) { + try { + return await writeCover(audioPath, options); + } catch { + return null; + } +} + +// Pochette tirée d'une image envoyée. Erreur 400 si ce n'est pas une image PNG, JPEG, WebP ou GIF. +async function saveCoverFromImage(imagePath, options) { + const inputFormat = await detectImageFormat(imagePath); + if (!inputFormat) { + throw httpError(400, "Image non reconnue : PNG, JPEG, WebP ou GIF attendu"); + } + try { + return await writeCover(imagePath, { ...options, inputFormat }); + } catch (error) { + throw httpError(400, "Impossible de lire cette image", error); + } +} + +// Donne la pochette `name` (null : aucune) au morceau et supprime l'ancienne. Renvoie l'entrée, +// ou null si le morceau n'existe plus : la nouvelle pochette est alors supprimée. +function setTrackCover(trackId, name) { + const previous = findPermanentTrack(trackId); + if (!previous) { + deleteCoverFile(name); + return null; + } + const [track] = updatePermanentTracks(new Map([[trackId, { cover: name }]])); + if (previous.cover && previous.cover !== name) { + deleteCoverFile(previous.cover); + } + return track; +} + +// Cherche la pochette intégrée d'un morceau jamais examiné. Si une pochette lui a été donnée +// pendant la recherche, elle est gardée. Renvoie l'entrée mise à jour, ou null. +async function fillEmbeddedCover(trackId, audioPath, options) { + const name = await saveCoverFromAudio(audioPath, options); + const current = findPermanentTrack(trackId); + if (!current || current.cover !== undefined) { + deleteCoverFile(name); + return null; + } + return updatePermanentTracks(new Map([[trackId, { cover: name }]]))[0]; +} + +export { fillEmbeddedCover, saveCoverFromImage, setTrackCover }; diff --git a/src/web/storage/libraryMetadata.js b/src/web/storage/libraryMetadata.js index 74e1a59..707bcf2 100644 --- a/src/web/storage/libraryMetadata.js +++ b/src/web/storage/libraryMetadata.js @@ -1,21 +1,22 @@ /** - * @file Complète au démarrage la durée et l'artiste des morceaux de la bibliothèque ajoutés avant que - * l'envoi ne les relève. + * @file Complète au démarrage la durée, l'artiste et la pochette intégrée des morceaux de la + * bibliothèque ajoutés avant que l'envoi ne les relève. * * Utilisé par : web/server.js (startWebServer). - * Attention : un fichier illisible est ignoré et retenté au démarrage suivant. + * Attention : un fichier illisible est ignoré et retenté au démarrage suivant, sauf pour la + * pochette : un morceau examiné une fois sans pochette garde `cover: null`. */ import { probeAudioFile } from "../../media/validateAudioFile.js"; +import { fillEmbeddedCover } from "./libraryCovers.js"; import { getPermanentLibrary, updatePermanentTracks } from "./storageManager.js"; -// Complète la durée et l'artiste des morceaux ajoutés avant que l'upload ne les relève. -// Un fichier illisible est ignoré : il sera retenté au prochain démarrage. -async function backfillLibraryMetadata({ probe = probeAudioFile } = {}) { - const missing = getPermanentLibrary().filter((entry) => entry.duration == null); +// Renvoie les entrées modifiées. probe et createCover remplacent ffprobe et ffmpeg (tests). +async function backfillLibraryMetadata({ probe = probeAudioFile, createCover } = {}) { + const library = getPermanentLibrary(); const updates = new Map(); - for (const entry of missing) { + for (const entry of library.filter((item) => item.duration == null)) { try { const { duration, artist } = await probe(entry.path); if (duration != null) { @@ -25,8 +26,16 @@ async function backfillLibraryMetadata({ probe = probeAudioFile } = {}) { console.error(`Unable to read metadata of library entry ${entry.id}`, error.cause ?? error); } } + const updated = new Map(updatePermanentTracks(updates).map((entry) => [entry.id, entry])); - return updatePermanentTracks(updates); + for (const entry of library.filter((item) => item.cover === undefined)) { + const withCover = await fillEmbeddedCover(entry.id, entry.path, { create: createCover }); + if (withCover?.cover) { + updated.set(withCover.id, withCover); + } + } + + return [...updated.values()]; } export { backfillLibraryMetadata }; diff --git a/src/web/storage/librarySections.js b/src/web/storage/librarySections.js new file mode 100644 index 0000000..b1690cf --- /dev/null +++ b/src/web/storage/librarySections.js @@ -0,0 +1,107 @@ +/** + * @file Sections de la bibliothèque : liste ordonnée de groupes nommés, enregistrée dans + * storage/runtime/sections.json. Chaque morceau désigne la sienne par son champ `sectionId`. + * + * Utilisé par : web/routes/librarySections.js, web/routes/library.js et uploads.js (section + * choisie pour un morceau). + * Attention : supprimer une section remet ses morceaux « sans section », sans les supprimer. Un + * fichier absent vaut une liste vide. + */ + +import fs from "node:fs"; +import path from "node:path"; +import { randomUUID } from "node:crypto"; +import { getPermanentLibrary, RUNTIME_DIR, updatePermanentTracks } from "./storageManager.js"; + +const SECTIONS_FILE = path.join(RUNTIME_DIR, "sections.json"); +const MAX_SECTIONS = 100; +const MAX_NAME_LENGTH = 80; + +function httpError(status, message) { + return Object.assign(new Error(message), { status }); +} + +function cleanName(value) { + const name = String(value ?? "") + .replace(/[\u0000-\u001f]/g, "") + .trim() + .slice(0, MAX_NAME_LENGTH); + if (!name) { + throw httpError(400, "Nom de section manquant"); + } + return name; +} + +function getSections() { + try { + const sections = JSON.parse(fs.readFileSync(SECTIONS_FILE, "utf8")); + if (!Array.isArray(sections)) { + throw new TypeError("sections.json doit contenir un tableau"); + } + return sections.filter( + (section) => typeof section?.id === "string" && typeof section.name === "string" + ); + } catch (error) { + if (error.code === "ENOENT") return []; + console.error("Failed to read sections file", error); + throw new Error("Impossible de lire les sections", { cause: error }); + } +} + +function writeSections(sections) { + fs.mkdirSync(RUNTIME_DIR, { recursive: true }); + const temporaryFile = `${SECTIONS_FILE}.${process.pid}.tmp`; + fs.writeFileSync(temporaryFile, JSON.stringify(sections, null, 2)); + fs.renameSync(temporaryFile, SECTIONS_FILE); +} + +function findSection(id) { + return typeof id === "string" ? getSections().find((section) => section.id === id) : undefined; +} + +function createSection(name) { + const sections = getSections(); + if (sections.length >= MAX_SECTIONS) { + throw httpError(409, `Pas plus de ${MAX_SECTIONS} sections`); + } + const section = { id: randomUUID(), name: cleanName(name) }; + sections.push(section); + writeSections(sections); + return section; +} + +// Renomme la section et/ou la déplace à `position` (0 : en tête). null si elle n'existe pas. +function updateSection(id, { name, position } = {}) { + const sections = getSections(); + const index = sections.findIndex((section) => section.id === id); + if (index === -1) return null; + + const section = sections[index]; + if (name !== undefined) { + section.name = cleanName(name); + } + if (position !== undefined) { + if (!Number.isInteger(position) || position < 0 || position >= sections.length) { + throw httpError(400, "Position invalide"); + } + sections.splice(index, 1); + sections.splice(position, 0, section); + } + writeSections(sections); + return section; +} + +// Supprime la section ; ses morceaux restent dans la bibliothèque, sans section. +function deleteSection(id) { + const sections = getSections(); + const index = sections.findIndex((section) => section.id === id); + if (index === -1) return null; + + const [removed] = sections.splice(index, 1); + writeSections(sections); + const orphans = getPermanentLibrary().filter((entry) => entry.sectionId === id); + updatePermanentTracks(new Map(orphans.map((entry) => [entry.id, { sectionId: null }]))); + return removed; +} + +export { createSection, deleteSection, findSection, getSections, updateSection }; diff --git a/src/web/storage/storageManager.js b/src/web/storage/storageManager.js index ea833ed..d82cc42 100644 --- a/src/web/storage/storageManager.js +++ b/src/web/storage/storageManager.js @@ -1,9 +1,12 @@ /** * @file Stockage des fichiers audio : storage/temp pour les morceaux joués une seule fois, - * storage/permanent et sa liste storage/runtime/library.json pour la bibliothèque. + * storage/permanent et sa liste storage/runtime/library.json pour la bibliothèque, et + * storage/covers pour les pochettes. * * Contexte : seul module qui crée, déplace ou supprime les fichiers audio et la liste de la - * bibliothèque. + * bibliothèque. Les pochettes sont créées par libraryCovers.js et les sections rangées par + * librarySections.js ; une entrée n'en garde que le nom de fichier (`cover`) et l'identifiant + * (`sectionId`). * Points d'entrée : registerUploadedFile (nouveau fichier), getPermanentLibrary, * createQueueTrackFromLibrary, cleanupTemporaryFiles, deleteTrackFile. * Utilisé par : music/ (ajout, file), web/routes/library.js et queue.js, /play, web/server.js. @@ -25,13 +28,14 @@ const STORAGE_ROOT = path.join(process.cwd(), "storage"); const PERMANENT_DIR = path.join(STORAGE_ROOT, "permanent"); const TEMP_DIR = path.join(STORAGE_ROOT, "temp"); const RUNTIME_DIR = path.join(STORAGE_ROOT, "runtime"); +const COVERS_DIR = path.join(STORAGE_ROOT, "covers"); const LIBRARY_FILE = path.join(RUNTIME_DIR, "library.json"); const LEGACY_LIBRARY_FILE = path.join(STORAGE_ROOT, "library.json"); const TEMP_FILE_MAX_AGE = 24 * 60 * 60 * 1000; const MAX_LIBRARY_SIZE = 2 * 1024 * 1024 * 1024; function ensureStorageLayout() { - for (const directory of [PERMANENT_DIR, TEMP_DIR, RUNTIME_DIR]) { + for (const directory of [PERMANENT_DIR, TEMP_DIR, RUNTIME_DIR, COVERS_DIR]) { fs.mkdirSync(directory, { recursive: true }); } @@ -100,6 +104,7 @@ function registerUploadedFile( title = file.originalname, duration = null, artist = null, + sectionId = null, } ) { ensureStorageLayout(); @@ -137,6 +142,7 @@ function registerUploadedFile( mimetype: file.mimetype, duration, artist, + sectionId, uploader, createdAt, }; @@ -236,6 +242,13 @@ function discardUploadedFile(file) { deleteFileSafe(file?.path); } +// Supprime une pochette d'après son nom de fichier (champ `cover` d'une entrée). +function deleteCoverFile(name) { + if (typeof name === "string" && name && path.basename(name) === name) { + deleteFileSafe(path.join(COVERS_DIR, name)); + } +} + // Modifie des champs d'entrées de la bibliothèque : updates est une Map id → champs. // Relit le fichier juste avant d'écrire, pour ne pas écraser un ajout fait entre-temps. function updatePermanentTracks(updates) { @@ -264,6 +277,7 @@ function deletePermanentTrack(id) { const [removed] = library.splice(index, 1); writeLibrary(library); deleteFileSafe(removed.path); + deleteCoverFile(removed.cover); return removed; } @@ -285,7 +299,9 @@ function deleteTrackFile(track) { } export { + COVERS_DIR, PERMANENT_DIR, + RUNTIME_DIR, TEMP_DIR, ensureStorageLayout, registerUploadedFile, @@ -294,6 +310,7 @@ export { createQueueTrackFromLibrary, cleanupTemporaryFiles, discardUploadedFile, + deleteCoverFile, deletePermanentTrack, updatePermanentTracks, handleTrackCompletion, diff --git a/test/coverArt.test.js b/test/coverArt.test.js new file mode 100644 index 0000000..5b23291 --- /dev/null +++ b/test/coverArt.test.js @@ -0,0 +1,87 @@ +/** + * @file Vérifie la fabrication des pochettes avec le vrai ffmpeg (image envoyée, pochette intégrée à + * un MP3) et le refus des fichiers qui ne sont pas des images ; ignoré sans ffmpeg. + */ + +import test from "node:test"; +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; +import { createCoverImage, detectImageFormat } from "../src/media/coverArt.js"; + +const hasFfmpeg = + spawnSync("ffmpeg", ["-version"]).status === 0 && + spawnSync("ffprobe", ["-version"]).status === 0; +const skip = hasFfmpeg ? false : "ffmpeg et ffprobe sont nécessaires"; + +const directory = fs.mkdtempSync(path.join(os.tmpdir(), "palico-cover-")); +test.after(() => fs.rmSync(directory, { recursive: true, force: true })); + +function ffmpeg(...args) { + const result = spawnSync("ffmpeg", ["-v", "error", "-y", ...args]); + assert.equal(result.status, 0, result.stderr?.toString()); +} + +function imageSize(file) { + const result = spawnSync("ffprobe", [ + "-v", "error", "-select_streams", "v:0", + "-show_entries", "stream=width,height,codec_name", "-of", "json", file, + ]); + return JSON.parse(result.stdout.toString()).streams[0]; +} + +test("image signatures are recognised, other files are not", async () => { + const samples = { + "a.png": Buffer.from("89504e470d0a1a0a0000000d", "hex"), + "a.jpg": Buffer.from("ffd8ffe000104a4649460001", "hex"), + "a.gif": Buffer.from("GIF89a\x01\x00\x01\x00\x00\x00", "latin1"), + "a.webp": Buffer.from("RIFF\x24\x00\x00\x00WEBPVP8 ", "latin1"), + "playlist.png": Buffer.from("#EXTM3U\n#EXT-X-MEDIA-SEQUENCE:0\n"), + "short.png": Buffer.from("89504e47", "hex"), + }; + const formats = {}; + for (const [name, bytes] of Object.entries(samples)) { + const file = path.join(directory, name); + fs.writeFileSync(file, bytes); + formats[name] = await detectImageFormat(file); + } + assert.deepEqual(formats, { + "a.png": "png_pipe", + "a.jpg": "jpeg_pipe", + "a.gif": "gif", + "a.webp": "webp_pipe", + "playlist.png": null, + "short.png": null, + }); +}); + +test("an uploaded image becomes a JPEG of at most 512 px", { skip }, async () => { + const input = path.join(directory, "wide.png"); + ffmpeg("-f", "lavfi", "-i", "color=c=purple:s=1024x256", "-frames:v", "1", input); + const output = path.join(directory, "wide.jpg"); + + await createCoverImage(input, output, { inputFormat: await detectImageFormat(input) }); + + assert.deepEqual(imageSize(output), { codec_name: "mjpeg", width: 512, height: 128 }); +}); + +test("the cover embedded in an MP3 is extracted, and its absence is an error", { skip }, async () => { + const picture = path.join(directory, "picture.jpg"); + ffmpeg("-f", "lavfi", "-i", "color=c=orange:s=300x300", "-frames:v", "1", picture); + const withCover = path.join(directory, "with-cover.mp3"); + ffmpeg( + "-f", "lavfi", "-i", "sine=frequency=440:duration=1", "-i", picture, + "-map", "0:a", "-map", "1:v", "-c:a", "libmp3lame", "-c:v", "copy", + "-disposition:v", "attached_pic", withCover + ); + const withoutCover = path.join(directory, "without-cover.mp3"); + ffmpeg("-f", "lavfi", "-i", "sine=frequency=440:duration=1", "-c:a", "libmp3lame", withoutCover); + + const output = path.join(directory, "extracted.jpg"); + await createCoverImage(withCover, output); + assert.deepEqual(imageSize(output), { codec_name: "mjpeg", width: 300, height: 300 }); + + await assert.rejects(createCoverImage(withoutCover, path.join(directory, "none.jpg"))); +}); diff --git a/test/libraryCovers.test.js b/test/libraryCovers.test.js new file mode 100644 index 0000000..57c392a --- /dev/null +++ b/test/libraryCovers.test.js @@ -0,0 +1,118 @@ +/** + * @file Vérifie le stockage des pochettes sans ffmpeg : pochette intégrée reprise à l'ajout, + * remplacement, refus d'un fichier qui n'est pas une image, suppression avec le morceau, et + * adresse donnée par l'API. + */ + +import test from "node:test"; +import assert from "node:assert/strict"; +import { EventEmitter } from "node:events"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; + +// storageManager.js fixe ses dossiers au chargement, d'après le répertoire de travail. +const originalDirectory = process.cwd(); +const temporaryDirectory = fs.mkdtempSync(path.join(os.tmpdir(), "palico-covers-")); +process.chdir(temporaryDirectory); +const storage = await import("../src/web/storage/storageManager.js"); +const covers = await import("../src/web/storage/libraryCovers.js"); +const { ingestAudioFile } = await import("../src/music/ingest.js"); +const { backfillLibraryMetadata } = await import("../src/web/storage/libraryMetadata.js"); +const { serializeTrack } = await import("../src/web/serializers.js"); +storage.ensureStorageLayout(); +test.after(() => { + process.chdir(originalDirectory); + fs.rmSync(temporaryDirectory, { recursive: true, force: true }); +}); + +// Remplace ffmpeg : écrit un faux JPEG, ou échoue comme pour un fichier sans pochette. +const fakeCreate = async (_input, output) => fs.writeFileSync(output, "jpeg"); +const noCover = async () => { + throw new Error("Output file does not contain any stream"); +}; +const probe = async () => ({ duration: 10, title: null, artist: null }); + +function tempFile(name, content = "audio") { + const filePath = path.join(storage.TEMP_DIR, `upload-${name}`); + fs.writeFileSync(filePath, Buffer.from(content, "latin1")); + return { path: filePath, originalname: name, size: content.length, mimetype: "audio/mpeg" }; +} + +function fakeQueue() { + const queue = new EventEmitter(); + queue.enqueue = () => {}; + return queue; +} + +const coverPath = (name) => path.join(storage.COVERS_DIR, name); + +test("a kept track takes the cover embedded in its file", async () => { + const track = await ingestAudioFile( + tempFile("with.mp3"), + { permanent: true }, + { queue: fakeQueue(), probe, createCover: fakeCreate } + ); + const entry = storage.findPermanentTrack(track.libraryTrackId); + assert.match(entry.cover, /^[0-9a-f-]{36}\.jpg$/); + assert.equal(fs.existsSync(coverPath(entry.cover)), true); + assert.equal(serializeTrack(entry).coverUrl, `/covers/${entry.cover}`); + assert.equal("cover" in serializeTrack(entry), false); + + const without = await ingestAudioFile( + tempFile("without.mp3"), + { permanent: true }, + { queue: fakeQueue(), probe, createCover: noCover } + ); + const withoutEntry = storage.findPermanentTrack(without.libraryTrackId); + // Examiné une fois : null, pour ne pas être retenté à chaque démarrage. + assert.equal(withoutEntry.cover, null); + assert.equal("coverUrl" in serializeTrack(withoutEntry), false); +}); + +test("a new cover replaces the old file, and only images are accepted", async () => { + const id = ( + await ingestAudioFile(tempFile("c.mp3"), { permanent: true }, { + queue: fakeQueue(), probe, createCover: fakeCreate, + }) + ).libraryTrackId; + const oldCover = storage.findPermanentTrack(id).cover; + + const png = tempFile("cover.png", "\x89PNG\r\n\x1a\n0000"); + const newCover = await covers.saveCoverFromImage(png.path, { create: fakeCreate }); + covers.setTrackCover(id, newCover); + assert.equal(storage.findPermanentTrack(id).cover, newCover); + assert.equal(fs.existsSync(coverPath(oldCover)), false); + + const text = tempFile("cover.txt", "#EXTM3U\nfile:///etc/passwd\n"); + await assert.rejects(covers.saveCoverFromImage(text.path, { create: fakeCreate }), { + status: 400, + }); + + covers.setTrackCover(id, null); + assert.equal(storage.findPermanentTrack(id).cover, null); + assert.equal(fs.existsSync(coverPath(newCover)), false); +}); + +test("deleting a track deletes its cover", async () => { + const { libraryTrackId } = await ingestAudioFile(tempFile("d.mp3"), { permanent: true }, { + queue: fakeQueue(), probe, createCover: fakeCreate, + }); + const { cover } = storage.findPermanentTrack(libraryTrackId); + storage.deletePermanentTrack(libraryTrackId); + assert.equal(fs.existsSync(coverPath(cover)), false); +}); + +test("the startup backfill looks once for the covers of older tracks", async () => { + const older = storage.registerUploadedFile(tempFile("old.mp3"), { + permanent: true, + duration: 10, + }).libraryTrackId; + assert.equal(storage.findPermanentTrack(older).cover, undefined); + + const updated = await backfillLibraryMetadata({ probe, createCover: fakeCreate }); + assert.deepEqual(updated.map((entry) => entry.id), [older]); + assert.ok(storage.findPermanentTrack(older).cover); + + assert.deepEqual(await backfillLibraryMetadata({ probe, createCover: fakeCreate }), []); +}); diff --git a/test/librarySections.test.js b/test/librarySections.test.js new file mode 100644 index 0000000..a67be16 --- /dev/null +++ b/test/librarySections.test.js @@ -0,0 +1,68 @@ +/** + * @file Vérifie les sections de la bibliothèque : création, renommage, déplacement, et suppression qui + * remet ses morceaux sans section. + */ + +import test from "node:test"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; + +// storageManager.js fixe ses dossiers au chargement, d'après le répertoire de travail. +const originalDirectory = process.cwd(); +const temporaryDirectory = fs.mkdtempSync(path.join(os.tmpdir(), "palico-sections-")); +process.chdir(temporaryDirectory); +const storage = await import("../src/web/storage/storageManager.js"); +const sections = await import("../src/web/storage/librarySections.js"); +storage.ensureStorageLayout(); +test.after(() => { + process.chdir(originalDirectory); + fs.rmSync(temporaryDirectory, { recursive: true, force: true }); +}); + +function addTrack(name, sectionId) { + const filePath = path.join(storage.TEMP_DIR, `upload-${name}`); + fs.writeFileSync(filePath, "audio"); + return storage.registerUploadedFile( + { path: filePath, originalname: name, size: 5, mimetype: "audio/mpeg" }, + { permanent: true, uploader: "test", sectionId } + ).libraryTrackId; +} + +test("sections are created, renamed and reordered", () => { + assert.deepEqual(sections.getSections(), []); + const chill = sections.createSection(" Chill\u0007 "); + const boss = sections.createSection("Combats de boss"); + const menu = sections.createSection("Menus"); + assert.equal(chill.name, "Chill"); + + sections.updateSection(menu.id, { name: "Écrans titres", position: 0 }); + assert.deepEqual( + sections.getSections().map((section) => section.name), + ["Écrans titres", "Chill", "Combats de boss"] + ); + assert.equal(sections.findSection(boss.id).name, "Combats de boss"); + assert.equal(sections.updateSection("unknown", { name: "x" }), null); +}); + +test("invalid names and positions are refused", () => { + const [first] = sections.getSections(); + assert.throws(() => sections.createSection(" "), { status: 400 }); + assert.throws(() => sections.updateSection(first.id, { position: 99 }), { status: 400 }); + assert.throws(() => sections.updateSection(first.id, { position: "1" }), { status: 400 }); +}); + +test("deleting a section keeps its tracks, without a section", () => { + const doomed = sections.createSection("À supprimer"); + const kept = sections.createSection("Gardée"); + const inDoomed = addTrack("a.mp3", doomed.id); + const inKept = addTrack("b.mp3", kept.id); + + assert.equal(sections.deleteSection(doomed.id).id, doomed.id); + + assert.equal(sections.findSection(doomed.id), undefined); + assert.equal(storage.findPermanentTrack(inDoomed).sectionId, null); + assert.equal(storage.findPermanentTrack(inKept).sectionId, kept.id); + assert.equal(sections.deleteSection(doomed.id), null); +}); From 793765fb791c2b40a31d4f08b513bc03612328f3 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 1 Dec 2026 23:11:05 +0100 Subject: [PATCH 3/7] Resume interrupted tracks where they stopped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- README.md | 5 +++ public/scripts/jukebox.js | 2 + src/features/formatTrack.js | 11 ++++-- src/media/validateAudioFile.js | 8 +++- src/music/queue.js | 67 ++++++++++++++++++++++++++-------- test/audio.test.js | 13 +++++++ test/commands.test.js | 3 +- test/musicQueue.test.js | 56 ++++++++++++++++++++++++++-- 8 files changed, 141 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e08aa4c..260d812 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,11 @@ file d'attente. - La file est enregistrée dans `storage/runtime/queue.json` : après un redémarrage, elle reprend dès que quelqu'un est dans le salon vocal. +- Un morceau interrompu malgré lui (connexion vocale perdue, bot parti faute + d'auditeurs, redémarrage, même brutal) reprend 2 secondes avant l'endroit où + il s'était arrêté, au lieu de recommencer. Après un arrêt brutal, il peut + rejouer jusqu'à 30 secondes de plus : la position est enregistrée toutes les + 30 s. - La page web reçoit les changements en direct par `GET /api/events` (Server-Sent Events, même clé que le reste de l'API). diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index 5f2e46e..55ae1be 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -325,6 +325,8 @@ function trackMeta(track) { const parts = []; const duration = formatDuration(track.duration); if (duration) parts.push(duration); + // Morceau interrompu (connexion perdue, redémarrage) : il reprend à cette position. + if (track.resumeAt > 0) parts.push(`Reprise à ${formatDuration(track.resumeAt)}`); parts.push(track.permanent ? "Permanent" : "Temporaire"); if (track.size) parts.push(formatBytes(track.size)); parts.push(`Ajouté par ${escapeHtml(track.uploader || "inconnu")}`); diff --git a/src/features/formatTrack.js b/src/features/formatTrack.js index 3d55266..6e42919 100644 --- a/src/features/formatTrack.js +++ b/src/features/formatTrack.js @@ -1,5 +1,6 @@ /** - * @file Formate un morceau pour les messages Discord : titre et durée lisible. + * @file Formate un morceau pour les messages Discord : titre, durée lisible et, pour un morceau + * interrompu, sa position de reprise. * * Utilisé par : les commandes /play, /queue et /skip. * Attention : la page web a son propre formatDuration (public/scripts/common.js). @@ -17,8 +18,12 @@ function formatDuration(seconds) { function trackLabel(track) { const title = track.title || track.originalName || "Sans titre"; - const duration = formatDuration(track.duration); - return duration ? `${title} (${duration})` : title; + const details = [formatDuration(track.duration)]; + if (track.resumeAt > 0) { + details.push(`reprise à ${formatDuration(track.resumeAt)}`); + } + const text = details.filter(Boolean).join(", "); + return text ? `${title} (${text})` : title; } export { formatDuration, trackLabel }; diff --git a/src/media/validateAudioFile.js b/src/media/validateAudioFile.js index 331e8ed..b83182e 100644 --- a/src/media/validateAudioFile.js +++ b/src/media/validateAudioFile.js @@ -1,6 +1,7 @@ /** * @file Vérifie avec ffprobe qu'un fichier est de l'audio (durée, titre, artiste), et le convertit - * avec ffmpeg en Ogg Opus au volume normalisé, prêt pour Discord. + * avec ffmpeg en Ogg Opus au volume normalisé, prêt pour Discord (depuis le début ou depuis une + * position donnée). * * Utilisé par : music/ingest.js et storage/libraryMetadata.js (probeAudioFile), music/queue.js * (createOpusStream). @@ -81,13 +82,16 @@ function invalidAudioError(cause) { // Décode le fichier, normalise le volume et encode en Ogg Opus avec le ffmpeg natif : Discord // reçoit l'Opus tel quel, sans réencodage en JavaScript. Fermer le flux arrête ffmpeg. -function createOpusStream(filePath, { spawnProcess = spawn } = {}) { +// startAt : position de départ en secondes, pour reprendre un morceau interrompu. +function createOpusStream(filePath, { spawnProcess = spawn, startAt = 0 } = {}) { const ffmpeg = spawnProcess( "ffmpeg", [ "-hide_banner", "-loglevel", "error", + // Placé avant -i : ffmpeg saute directement à la position au lieu de tout décoder. + ...(startAt > 0 ? ["-ss", String(startAt)] : []), "-i", filePath, "-map", diff --git a/src/music/queue.js b/src/music/queue.js index 1959b6f..7083ac9 100644 --- a/src/music/queue.js +++ b/src/music/queue.js @@ -13,6 +13,10 @@ * - Sans morceau ou sans auditeur pendant 5 min, le bot quitte le salon. Parti faute d'auditeurs, * il revient dès que quelqu'un le rejoint. * - Un morceau temporaire est supprimé une fois joué, retiré ou en erreur, sauf en mode boucle. + * - Un morceau interrompu sans qu'on l'ait demandé (connexion vocale perdue, bot seul dans le + * salon, redémarrage) revient en tête de file avec `resumeAt` : il reprend 2 s avant l'endroit + * où il s'était arrêté. Le lecteur joue même sans connexion (NoSubscriberBehavior.Play) : la + * position d'une coupure est donc relevée dès la déconnexion, pas quand on abandonne. * - Toute modification de la file émet « queueUpdate » : c'est aussi ce qui l'enregistre. * @see README.md#jukebox */ @@ -44,6 +48,12 @@ const AUTO_DISCONNECT_DELAY = 5 * 60 * 1000; // file attend une action (ajout d'un morceau, bouton Play). const CONNECT_RETRY_DELAYS = [5_000, 15_000, 30_000, 60_000, 60_000]; +// Secondes rejouées à la reprise d'un morceau interrompu, pour retrouver le fil. +const RESUME_REWIND = 2; +// Pendant la lecture, la position est enregistrée à cet intervalle : après un arrêt brutal du +// bot (sans arrêt propre), le morceau reprend à peu près où il en était. +const POSITION_SAVE_INTERVAL = 30_000; + class MusicQueue extends EventEmitter { // persistence : { load() → état | null, save(état) } pour garder la file d'un démarrage à // l'autre (voir queuePersistence.js). Sans elle, la file est perdue à l'arrêt. @@ -92,8 +102,8 @@ class MusicQueue extends EventEmitter { this.currentTrack = null; if (finished) { if (this.loop && !this.discardCurrent && !this.shuttingDown) { - // Mode boucle : le morceau repart en fin de file, fichier conservé. - const { startedAt: _startedAt, ...track } = finished; + // Mode boucle : le morceau repart en fin de file, du début, fichier conservé. + const { startedAt: _startedAt, resumeAt: _resumeAt, ...track } = finished; this.queue.push({ ...track, id: randomUUID() }); } else { handleTrackCompletion(finished); @@ -114,6 +124,12 @@ class MusicQueue extends EventEmitter { this.on("queueUpdate", () => this.scheduleSave()); this.restore(); + if (this.persistence) { + this.positionSaveInterval = setInterval(() => { + if (this.playbackStatus === AudioPlayerStatus.Playing) this.scheduleSave(); + }, POSITION_SAVE_INTERVAL); + this.positionSaveInterval.unref?.(); + } this.audioPlayer.on("stateChange", (oldState, newState) => { this.playbackStatus = newState.status; @@ -127,11 +143,27 @@ class MusicQueue extends EventEmitter { upcoming: serializeTracks(this.queue), status: this.playbackStatus, loop: this.loop, - // Millisecondes déjà jouées du morceau en cours (pauses exclues). - position: this.audioPlayer?.state?.resource?.playbackDuration ?? 0, + // Position dans le morceau en cours, en millisecondes (pauses exclues). + position: this.currentPosition(), }; } + // Position dans le fichier du morceau en cours (ms), reprise comprise : playbackDuration ne + // compte que ce qui a été joué depuis le départ du flux. + currentPosition() { + if (!this.currentTrack) return 0; + const played = this.audioPlayer?.state?.resource?.playbackDuration ?? 0; + return (this.currentTrack.resumeAt ?? 0) * 1000 + played; + } + + // Copie d'un morceau interrompu à `position` (ms), à remettre en file pour qu'il reprenne un + // peu avant cet endroit. + resumableTrack(track, position) { + const { startedAt: _startedAt, resumeAt: _resumeAt, ...rest } = track; + const resumeAt = Math.floor(position / 1000) - RESUME_REWIND; + return resumeAt > 0 ? { ...rest, resumeAt } : rest; + } + // Fichiers encore utiles (file d'attente et morceau en cours), à ne pas nettoyer. inUsePaths() { return new Set( @@ -183,6 +215,8 @@ class MusicQueue extends EventEmitter { this.connection = connection; connection.subscribe(this.audioPlayer); connection.on(VoiceConnectionStatus.Disconnected, async () => { + // Le lecteur continue sans connexion : la reprise se fera depuis l'instant de la coupure. + const position = this.currentPosition(); try { await Promise.race([ entersState(connection, VoiceConnectionStatus.Signalling, 5_000), @@ -190,7 +224,7 @@ class MusicQueue extends EventEmitter { ]); } catch { if (this.connection === connection) { - this.destroyConnection("voice connection lost", { requeue: true }); + this.destroyConnection("voice connection lost", { requeue: true, position }); } } }); @@ -294,7 +328,7 @@ class MusicQueue extends EventEmitter { } createResource(track) { - return createAudioResource(createOpusStream(track.path), { + return createAudioResource(createOpusStream(track.path, { startAt: track.resumeAt }), { inputType: StreamType.OggOpus, }); } @@ -445,9 +479,10 @@ class MusicQueue extends EventEmitter { return removed; } - // requeue : remet le morceau interrompu en tête de file (il reprendra du début) au lieu - // de le perdre, quand la coupure ne vient pas d'une demande d'arrêt. - destroyConnection(reason, { suspend = false, requeue = false } = {}) { + // requeue : remet le morceau interrompu en tête de file, pour qu'il reprenne où il en était + // (à `position` ms si elle est donnée, sinon à la position actuelle), au lieu de le perdre, + // quand la coupure ne vient pas d'une demande d'arrêt. + destroyConnection(reason, { suspend = false, requeue = false, position } = {}) { if (!this.connection && this.playbackStatus === AudioPlayerStatus.Idle) { return; } @@ -460,11 +495,11 @@ class MusicQueue extends EventEmitter { this.cancelAloneDisconnect(); const interruptedTrack = this.currentTrack; + const interruptedAt = position ?? this.currentPosition(); this.currentTrack = null; const requeued = Boolean(requeue && interruptedTrack); if (requeued) { - const { startedAt: _startedAt, ...track } = interruptedTrack; - this.queue.unshift(track); + this.queue.unshift(this.resumableTrack(interruptedTrack, interruptedAt)); } if (this.connection) { @@ -594,6 +629,7 @@ class MusicQueue extends EventEmitter { this.cancelAloneDisconnect(); this.cancelConnectRetry(); clearTimeout(this.saveTimeout); + clearInterval(this.positionSaveInterval); this.client.off(Events.VoiceStateUpdate, this.voiceStateListener); if (this.persistence) { @@ -608,11 +644,12 @@ class MusicQueue extends EventEmitter { } persistedState() { + const current = this.currentTrack + ? this.resumableTrack(this.currentTrack, this.currentPosition()) + : null; return { - // Le morceau en cours reprendra du début, en tête de file. - queue: [this.currentTrack, ...this.queue] - .filter(Boolean) - .map(({ startedAt: _startedAt, ...track }) => track), + // Le morceau en cours reprendra en tête de file, à peu près où il en était. + queue: [current, ...this.queue].filter(Boolean), loop: this.loop, }; } diff --git a/test/audio.test.js b/test/audio.test.js index f0de568..afed06e 100644 --- a/test/audio.test.js +++ b/test/audio.test.js @@ -60,6 +60,19 @@ test("createOpusStream yields Opus packets that Discord can play as is", { skip assert.ok(packets >= 45, `${packets} paquets`); }); +test("createOpusStream can start in the middle of a track", { skip }, async () => { + const resource = createAudioResource(createOpusStream(makeTone("three.mp3", 3), { startAt: 2 }), { + inputType: StreamType.OggOpus, + }); + + let packets = 0; + for await (const _packet of resource.playStream) { + packets += 1; + } + // Seule la dernière seconde est jouée : une cinquantaine de paquets de 20 ms, pas 150. + assert.ok(packets >= 40 && packets <= 70, `${packets} paquets`); +}); + test("closing the Opus stream stops ffmpeg", { skip }, async () => { let child; const output = createOpusStream(makeTone("long.mp3", 120), { diff --git a/test/commands.test.js b/test/commands.test.js index 92654f3..d0ff2a0 100644 --- a/test/commands.test.js +++ b/test/commands.test.js @@ -73,10 +73,11 @@ test("/queue lists the current track and what comes next", async () => { const { buildQueueMessage } = await import("../src/commands/jukebox/queue.js"); const message = buildQueueMessage({ currentTrack: { title: "Thème *principal*", duration: 187 }, - queue: [{ title: "Suite", duration: 3909 }], + queue: [{ title: "Suite", duration: 3909 }, { title: "Mix", duration: 3600, resumeAt: 2955 }], }); assert.match(message, /En cours : \*\*Thème \\\*principal\\\* \(3:07\)\*\*/); assert.match(message, /1\. Suite \(1:05:09\)/); + assert.match(message, /2\. Mix \(1:00:00, reprise à 49:15\)/); }); test("vocal commands act on the caller's voice channel, skipping bots", async () => { diff --git a/test/musicQueue.test.js b/test/musicQueue.test.js index 937e990..5a9ce1a 100644 --- a/test/musicQueue.test.js +++ b/test/musicQueue.test.js @@ -1,6 +1,7 @@ /** * @file Couvre la file du jukebox sans Discord : lecture, reconnexion, départ et retour du bot dans le - * salon, mode boucle, mélange et reprise après un redémarrage. + * salon, reprise d'un morceau interrompu à sa position, mode boucle, mélange et reprise après + * un redémarrage. */ import test from "node:test"; @@ -93,6 +94,15 @@ function fakeQueue(client, { connect = async () => {}, retryDelays } = {}) { const track = (id) => ({ id, path: `/nonexistent/${id}`, permanent: true }); const settle = () => new Promise((resolve) => setTimeout(resolve, 20)); +// Simule un morceau en cours dont `playedMs` millisecondes ont été jouées depuis le départ du flux. +function setPlayed(queue, playedMs) { + Object.defineProperty(queue.audioPlayer, "state", { + value: { status: "playing", resource: { playbackDuration: playedMs } }, + writable: true, + configurable: true, + }); +} + test("adding a track resumes a queue suspended because the bot was alone", async () => { const { client } = fakeClient(); const { queue, played } = fakeQueue(client); @@ -193,6 +203,37 @@ test("leaving an empty channel keeps the interrupted track at the head of the qu queue.shutdown(); }); +test("an interrupted track resumes a little before where it stopped", () => { + const { client } = fakeClient([BOT_ID]); + const { queue } = fakeQueue(client); + + // Déjà repris à 100 s, puis 25,4 s jouées : il était à 125,4 s, et reprendra à 123 s. + queue.connection = { destroy() {} }; + queue.currentTrack = { ...track("a"), resumeAt: 100, startedAt: "2026-01-01T00:00:00.000Z" }; + setPlayed(queue, 25_400); + assert.equal(queue.snapshot().position, 125_400); + queue.destroyConnection("alone timeout", { suspend: true, requeue: true }); + assert.equal(queue.queue[0].resumeAt, 123); + assert.equal("startedAt" in queue.queue[0], false); + + // Connexion perdue : la position est celle relevée à la coupure, pas celle de l'abandon. + queue.queue = []; + queue.connection = { destroy() {} }; + queue.currentTrack = track("b"); + setPlayed(queue, 65_000); + queue.destroyConnection("voice connection lost", { requeue: true, position: 60_000 }); + assert.equal(queue.queue[0].resumeAt, 58); + + // Interrompu dans ses premières secondes : il repart du début. + queue.queue = []; + queue.connection = { destroy() {} }; + queue.currentTrack = track("c"); + setPlayed(queue, 1_500); + queue.destroyConnection("voice connection lost", { requeue: true }); + assert.equal("resumeAt" in queue.queue[0], false); + queue.shutdown(); +}); + test("other bots do not count as listeners", () => { const { client, members } = fakeClient([BOT_ID, "otherbot-1"]); const { queue } = fakeQueue(client); @@ -207,12 +248,14 @@ test("in loop mode a finished track goes back to the end of the queue", () => { const { client } = fakeClient(); const { queue } = fakeQueue(client); queue.setLoop(true); - queue.currentTrack = track("a"); + queue.currentTrack = { ...track("a"), resumeAt: 50 }; queue.queue.push(track("b")); queue.playNext = () => {}; queue.audioPlayer.emit("idle"); assert.deepEqual(queue.queue.map(({ path }) => path), ["/nonexistent/b", "/nonexistent/a"]); + // Le morceau repris en cours de route repart du début au tour suivant. + assert.equal("resumeAt" in queue.queue[1], false); // Un morceau retiré ou en erreur ne revient pas. queue.currentTrack = track("c"); @@ -241,13 +284,20 @@ test("the queue survives a restart and waits for listeners", () => { first.currentTrack = { ...track("a"), startedAt: "2026-01-01T00:00:00.000Z" }; first.connection = { destroy() {} }; first.setLoop(true); - first.shutdown(); + setPlayed(first, 90_000); + // Enregistrement pendant la lecture (couvre un arrêt brutal) : la position y figure déjà. + first.save(); + assert.equal(saved.queue[0].resumeAt, 88); + + first.shutdown(); assert.deepEqual(saved.queue.map(({ id }) => id), ["a", "b"]); assert.equal("startedAt" in saved.queue[0], false); + assert.equal(saved.queue[0].resumeAt, 88); const second = new MusicQueue(client, { persistence }); assert.deepEqual(second.queue.map(({ id }) => id), ["a", "b"]); + assert.equal(second.queue[0].resumeAt, 88); assert.equal(second.loop, true); assert.equal(second.suspendedForAlone, true); second.shutdown(); From bda95ca946a33f0ffee6b4885a8d3f892a5e3ab7 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 1 Dec 2026 23:11:05 +0100 Subject: [PATCH 4/7] Add section images, larger covers and track tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Section images: - A section gets an optional image, set from its new "Modifier" dialog (name and image), which replaces "Renommer". It goes through the same conversion as track covers and is deleted with its section. - Track and section uploads share routes/coverUpload.js. The cover folder is created again if it went missing, instead of failing. Larger images: 72 px for tracks (was 48), 96 px for section headers, 160 px in the player and the edit dialog (was 96); smaller on phones. Tags: - Library tracks take free tags, edited in the "Modifier" dialog, which suggests the tags already in use. Case is ignored ("Épique" and "épique" are one tag); at most 15 tags of 30 characters. - A tag bar above the library filters it, and the "Tout ajouter" buttons (global and per section) then only queue its tracks (enqueue-all takes a tag). The search also matches tags. Co-Authored-By: Claude Opus 5.5 --- README.md | 15 +- public/jukebox.html | 46 +++-- public/scripts/jukebox.js | 285 +++++++++++++++++++++-------- public/style/styles.css | 107 +++++++++-- src/features/tags.js | 42 +++++ src/web/routes/coverUpload.js | 41 +++++ src/web/routes/library.js | 58 +++--- src/web/routes/librarySections.js | 36 +++- src/web/serializers.js | 27 ++- src/web/storage/libraryCovers.js | 8 +- src/web/storage/librarySections.js | 45 ++++- test/librarySections.test.js | 27 ++- test/tags.test.js | 29 +++ 13 files changed, 601 insertions(+), 165 deletions(-) create mode 100644 src/features/tags.js create mode 100644 src/web/routes/coverUpload.js create mode 100644 test/tags.test.js diff --git a/README.md b/README.md index 260d812..40d63ee 100644 --- a/README.md +++ b/README.md @@ -105,11 +105,16 @@ file d'attente. - Chaque morceau passe par `ffmpeg`, qui normalise le volume (EBU R128) et encode en Opus : Discord reçoit l'audio sans réencodage. - La page web range la bibliothèque en sections (chacune peut être ajoutée à - la file d'un coup, mélangée ou non) et donne une pochette à chaque morceau : - celle intégrée au fichier est reprise à l'ajout, et le bouton « Modifier » - permet d'en envoyer une autre (PNG, JPEG, WebP ou GIF), réduite en JPEG de - 512 px. Les pochettes sont servies sous `/covers/` sans authentification, - sous des noms aléatoires que seule l'API donne. + la file d'un coup, mélangée ou non) et donne une image à chaque section et + une pochette à chaque morceau : celle intégrée au fichier est reprise à + l'ajout, et le bouton « Modifier » permet d'en envoyer une autre (PNG, JPEG, + WebP ou GIF), réduite en JPEG de 512 px. Images et pochettes sont servies + sous `/covers/` sans authentification, sous des noms aléatoires que seule + l'API donne. +- Les morceaux de la bibliothèque peuvent recevoir des étiquettes libres + (« épique », « calme »…), sans distinction de majuscules. Choisir une + étiquette au-dessus de la liste filtre la bibliothèque, et les boutons + « Tout ajouter » n'ajoutent alors que ses morceaux. - La file est enregistrée dans `storage/runtime/queue.json` : après un redémarrage, elle reprend dès que quelqu'un est dans le salon vocal. diff --git a/public/jukebox.html b/public/jukebox.html index e02dde6..ef2fef1 100644 --- a/public/jukebox.html +++ b/public/jukebox.html @@ -169,7 +169,7 @@

      Bibliothèque permanente

      Les fichiers conservés sont listés ici. Range-les en sections, - donne-leur une pochette, ajoute-les à la file. + donne-leur une image, ajoute-les à la file.

      @@ -184,38 +184,48 @@ +

      Aucun fichier permanent enregistré.

      - - -

      Modifier le morceau

      + + +

      Modifier le morceau

      -
      - -
      - - -

      PNG, JPEG, WebP ou GIF, 10 Mo au plus. Recadrée à 512 px.

      -
      - - + + - - +
      + + +
      + +
      + + +

      Sépare-les par des virgules. Clique sur une étiquette existante pour l'ajouter.

      +
      +
      - - + +
      diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index 55ae1be..42c544d 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -14,6 +14,8 @@ * - Tout texte venu de l'API passe par escapeHtml avant d'aller dans innerHTML. * - Les morceaux de la file n'ont pas de pochette : elle est prise sur leur morceau de bibliothèque * (libraryTrackId), d'où le nouvel affichage de la file à chaque changement de la bibliothèque. + * - Le filtre par étiquette (state.activeTag) vaut aussi pour les boutons « Tout ajouter » : seuls + * les morceaux affichés partent dans la file. La recherche, elle, n'agit que sur l'affichage. * - L'aperçu d'une pochette choisie passe par une URL data: ; la politique de sécurité des contenus * (helmet) refuse les URL blob:. * @see README.md#jukebox @@ -52,6 +54,8 @@ const state = { sections: [], // Sections repliées par la personne ("" : les morceaux sans section). collapsedSections: new Set(), + // Étiquette choisie pour filtrer la bibliothèque, ou null. + activeTag: null, status: "idle", loop: false, // Position du morceau en cours (ms) au moment où l'état a été reçu. @@ -89,6 +93,7 @@ const elements = { libraryList: $("libraryList"), libraryEmpty: $("libraryEmpty"), librarySearch: $("librarySearch"), + libraryTags: $("libraryTags"), newSectionBtn: $("newSectionBtn"), enqueueAllBtn: $("enqueueAllBtn"), enqueueAllShuffledBtn: $("enqueueAllShuffledBtn"), @@ -108,15 +113,22 @@ const elements = { heroUploadBtn: $("heroUploadBtn"), heroQueueBtn: $("heroQueueBtn"), queueSection: $("queueSection"), - trackDialog: $("trackDialog"), - trackForm: $("trackForm"), - trackCoverPreview: $("trackCoverPreview"), - trackCoverInput: $("trackCoverInput"), - trackCoverRemoveBtn: $("trackCoverRemoveBtn"), - trackTitleInput: $("trackTitleInput"), - trackSectionSelect: $("trackSectionSelect"), - trackCancelBtn: $("trackCancelBtn"), - trackSaveBtn: $("trackSaveBtn"), + editDialog: $("editDialog"), + editDialogTitle: $("editDialogTitle"), + editForm: $("editForm"), + editCoverPreview: $("editCoverPreview"), + editCoverLabel: $("editCoverLabel"), + editCoverInput: $("editCoverInput"), + editCoverRemoveBtn: $("editCoverRemoveBtn"), + editNameLabel: $("editNameLabel"), + editNameInput: $("editNameInput"), + editSectionField: $("editSectionField"), + editSectionSelect: $("editSectionSelect"), + editTagsField: $("editTagsField"), + editTagsInput: $("editTagsInput"), + editTagSuggestions: $("editTagSuggestions"), + editCancelBtn: $("editCancelBtn"), + editSaveBtn: $("editSaveBtn"), }; const { setStatus, clearStatus } = createStatusManager(elements.status); @@ -423,22 +435,86 @@ function libraryGroups() { return [...groups, unsorted]; } +// Étiquettes : « Calme » et « calme » sont la même (comme sur le serveur, features/tags.js). +const tagKey = (tag) => tag.toLocaleLowerCase("fr"); +const trackHasTag = (track, tag) => (track.tags ?? []).some((item) => tagKey(item) === tagKey(tag)); + +// Étiquettes de la bibliothèque, par ordre alphabétique, avec leur nombre de morceaux. +function libraryTags() { + const tags = new Map(); + for (const track of state.library) { + for (const tag of track.tags ?? []) { + const entry = tags.get(tagKey(tag)) ?? { label: tag, count: 0 }; + entry.count += 1; + tags.set(tagKey(tag), entry); + } + } + return [...tags.values()].sort((a, b) => a.label.localeCompare(b.label, "fr")); +} + +function setActiveTag(tag) { + state.activeTag = tag && state.activeTag && tagKey(tag) === tagKey(state.activeTag) ? null : tag; + renderLibrary(); +} + +function tagButton(tag, { pressed = false, count } = {}) { + const button = document.createElement("button"); + button.type = "button"; + button.className = "tag"; + button.textContent = tag; + if (count !== undefined) { + const badge = document.createElement("span"); + badge.className = "tag__count"; + badge.textContent = String(count); + button.append(badge); + } + button.setAttribute("aria-pressed", String(pressed)); + button.addEventListener("click", () => setActiveTag(tag)); + return button; +} + +function renderTagFilter() { + const tags = libraryTags(); + if (state.activeTag && !tags.some(({ label }) => tagKey(label) === tagKey(state.activeTag))) { + state.activeTag = null; + } + elements.libraryTags.hidden = tags.length === 0; + elements.libraryTags.replaceChildren( + ...tags.map(({ label, count }) => + tagButton(label, { + count, + pressed: Boolean(state.activeTag) && tagKey(label) === tagKey(state.activeTag), + }) + ) + ); +} + function renderLibrary() { + renderTagFilter(); const query = elements.librarySearch.value.trim().toLowerCase(); + const tag = state.activeTag; const matches = (track) => - `${track.title || ""} ${track.originalName || ""} ${track.artist || ""}` + (!tag || trackHasTag(track, tag)) && + `${track.title || ""} ${track.originalName || ""} ${track.artist || ""} ${(track.tags ?? []).join(" ")}` .toLowerCase() .includes(query); const matchCount = state.library.filter(matches).length; + const filtering = Boolean(query || tag); elements.libraryList.replaceChildren(); const isEmpty = state.library.length === 0 && state.sections.length === 0; - elements.libraryEmpty.hidden = !isEmpty && (matchCount > 0 || !query); + elements.libraryEmpty.hidden = !isEmpty && (matchCount > 0 || !filtering); elements.libraryEmpty.textContent = isEmpty ? "Aucun fichier permanent enregistré." : "Aucun morceau ne correspond à la recherche."; - elements.enqueueAllBtn.disabled = state.library.length === 0; - elements.enqueueAllShuffledBtn.disabled = state.library.length === 0; + // Avec une étiquette choisie, les boutons n'ajoutent que ses morceaux. + const taggedCount = tag ? state.library.filter((track) => trackHasTag(track, tag)).length : 0; + elements.enqueueAllBtn.textContent = tag ? `Ajouter « ${tag} »` : "Tout ajouter"; + elements.enqueueAllShuffledBtn.textContent = tag + ? `Ajouter « ${tag} », mélangé` + : "Tout ajouter, mélangé"; + elements.enqueueAllBtn.disabled = (tag ? taggedCount : state.library.length) === 0; + elements.enqueueAllShuffledBtn.disabled = elements.enqueueAllBtn.disabled; // Sans section créée, la bibliothèque reste une simple liste. if (state.sections.length === 0) { @@ -449,12 +525,12 @@ function renderLibrary() { const groups = libraryGroups(); groups.forEach((group, index) => { const shown = group.tracks.filter(matches); - if (shown.length === 0 && (query || !group.section)) return; + if (shown.length === 0 && (filtering || !group.section)) return; elements.libraryList.append( renderSection(group, shown, { index, last: state.sections.length - 1, - searching: Boolean(query), + searching: filtering, }) ); }); @@ -473,12 +549,19 @@ function renderSection({ section, tracks }, shown, { index, last, searching }) { const total = tracks.reduce((sum, track) => sum + (track.duration || 0), 0); const count = searching ? `${shown.length} sur ${tracks.length}` : String(tracks.length); - const disabledIfEmpty = tracks.length === 0 ? "disabled" : ""; + // Avec une étiquette choisie, « Tout ajouter » n'ajoute que les morceaux qui la portent. + const addable = state.activeTag + ? tracks.filter((track) => trackHasTag(track, state.activeTag)).length + : tracks.length; + const disabledIfEmpty = addable === 0 ? "disabled" : ""; details.innerHTML = ` - ${escapeHtml(section?.name ?? "Sans section")} - - ${count} morceau(x)${total ? ` • ${formatDuration(total)}` : ""} + ${section?.coverUrl ? `` : ""} + + ${escapeHtml(section?.name ?? "Sans section")} + + ${count} morceau(x)${total ? ` • ${formatDuration(total)}` : ""} +
      @@ -486,7 +569,7 @@ function renderSection({ section, tracks }, shown, { index, last, searching }) { ${ section - ? ` + ? ` ` @@ -525,6 +608,7 @@ function renderTrackList(tracks) {
      ${duration ? `${duration} • ` : ""}${formatBytes(track.size)} • Ajouté le ${formatDate(track.createdAt)}
      +
      @@ -532,11 +616,18 @@ function renderTrackList(tracks) {
      `; - li.querySelectorAll("button").forEach((button) => { + li.querySelectorAll(".media-item__actions button").forEach((button) => { button.addEventListener("click", () => handleLibraryAction(button.dataset.action, track, button) ); }); + li.querySelector(".tag-list").append( + ...(track.tags ?? []).map((tag) => + tagButton(tag, { + pressed: Boolean(state.activeTag) && tagKey(tag) === tagKey(state.activeTag), + }) + ) + ); list.append(li); } return list; @@ -544,7 +635,7 @@ function renderTrackList(tracks) { // Listes de sections du formulaire d'ajout et de la fenêtre de modification. function renderSectionChoices() { - for (const select of [elements.uploadSectionSelect, elements.trackSectionSelect]) { + for (const select of [elements.uploadSectionSelect, elements.editSectionSelect]) { const selected = select.value; select.replaceChildren(new Option("Sans section", "")); for (const section of state.sections) { @@ -625,7 +716,7 @@ async function handleLibraryAction(action, track, button) { ); setStatus(`« ${track.title || track.originalName} » ajouté à la file`, "success"); } else if (action === "edit") { - openTrackEditor(track); + openEditor("track", track); return; } else if (action === "delete") { if (!confirm(`Supprimer « ${track.title || track.originalName} » de la bibliothèque ?`)) { @@ -648,7 +739,7 @@ async function enqueueAll(shuffle, button, sectionId) { const { tracks } = await withBusyButton(button, () => apiFetch("/library/enqueue-all", { method: "POST", - body: { shuffle, sectionId, requestedBy: requesterName() }, + body: { shuffle, sectionId, tag: state.activeTag ?? undefined, requestedBy: requesterName() }, }) ); setStatus(`${tracks.length} morceau(x) ajouté(s) à la file`, "success"); @@ -678,16 +769,11 @@ async function handleSectionAction(action, section, index, button) { await enqueueAll(action === "shuffle", button, section?.id ?? null); return; } - if (action === "rename") { - const name = prompt("Nouveau nom de la section", section.name); - if (!name || !name.trim()) return; - await withBusyButton(button, () => - apiFetch(`/library/sections/${section.id}`, { - method: "PATCH", - body: { name: name.trim() }, - }) - ); - } else if (action === "up" || action === "down") { + if (action === "edit") { + openEditor("section", section); + return; + } + if (action === "up" || action === "down") { const position = index + (action === "up" ? -1 : 1); await withBusyButton(button, () => apiFetch(`/library/sections/${section.id}`, { method: "PATCH", body: { position } }) @@ -711,80 +797,132 @@ async function handleSectionAction(action, section, index, button) { } // --------------------------------------------------------------------------- -// Fenêtre de modification d'un morceau (titre, section, pochette) +// Fenêtre de modification : morceau (titre, section, pochette) ou section (nom, image) const MAX_COVER_SIZE = 10 * 1024 * 1024; -let editedTrack = null; +// { kind: "track" | "section", item } pendant que la fenêtre est ouverte. +let editing = null; let removeCover = false; function showCoverPreview(url) { - const preview = elements.trackCoverPreview; + const preview = elements.editCoverPreview; preview.classList.toggle("cover--empty", !url); preview.style.backgroundImage = url ? `url("${url}")` : ""; } -function openTrackEditor(track) { - editedTrack = track; +function openEditor(kind, item) { + const isTrack = kind === "track"; + editing = { kind, item }; removeCover = false; - elements.trackTitleInput.value = track.title || track.originalName; - renderSectionChoices(); - elements.trackSectionSelect.value = track.sectionId ?? ""; - elements.trackCoverInput.value = ""; - elements.trackCoverRemoveBtn.hidden = !track.coverUrl; - showCoverPreview(track.coverUrl); - elements.trackDialog.showModal(); + elements.editDialogTitle.textContent = isTrack ? "Modifier le morceau" : "Modifier la section"; + elements.editCoverLabel.textContent = isTrack ? "Pochette" : "Image"; + elements.editCoverRemoveBtn.textContent = isTrack ? "Retirer la pochette" : "Retirer l'image"; + elements.editNameLabel.textContent = isTrack ? "Titre" : "Nom"; + elements.editNameInput.maxLength = isTrack ? 200 : 80; + elements.editNameInput.value = isTrack ? item.title || item.originalName : item.name; + elements.editSectionField.hidden = !isTrack; + elements.editTagsField.hidden = !isTrack; + if (isTrack) { + renderSectionChoices(); + elements.editSectionSelect.value = item.sectionId ?? ""; + elements.editTagsInput.value = (item.tags ?? []).join(", "); + renderTagSuggestions(); + } + elements.editCoverInput.value = ""; + elements.editCoverRemoveBtn.hidden = !item.coverUrl; + showCoverPreview(item.coverUrl); + elements.editDialog.showModal(); } function previewChosenCover() { - const file = elements.trackCoverInput.files[0]; + const file = elements.editCoverInput.files[0]; if (!file) { - showCoverPreview(removeCover ? null : editedTrack?.coverUrl); + showCoverPreview(removeCover ? null : editing?.item.coverUrl); return; } if (file.size > MAX_COVER_SIZE) { setStatus("Image trop lourde : 10 Mo au plus", "error"); - elements.trackCoverInput.value = ""; + elements.editCoverInput.value = ""; return; } const reader = new FileReader(); reader.addEventListener("load", () => showCoverPreview(reader.result)); reader.readAsDataURL(file); - elements.trackCoverRemoveBtn.hidden = false; + elements.editCoverRemoveBtn.hidden = false; } function clearChosenCover() { removeCover = true; - elements.trackCoverInput.value = ""; - elements.trackCoverRemoveBtn.hidden = true; + elements.editCoverInput.value = ""; + elements.editCoverRemoveBtn.hidden = true; showCoverPreview(null); } -async function saveTrackEditor(event) { - event.preventDefault(); - const track = editedTrack; - if (!track) return; +// Étiquettes tapées dans la fenêtre, séparées par des virgules. +function typedTags() { + return elements.editTagsInput.value + .split(",") + .map((tag) => tag.trim()) + .filter(Boolean); +} +// Étiquettes déjà utilisées dans la bibliothèque et pas encore tapées : un clic les ajoute. +function renderTagSuggestions() { + const typed = new Set(typedTags().map(tagKey)); + const suggestions = libraryTags().filter(({ label }) => !typed.has(tagKey(label))); + elements.editTagSuggestions.replaceChildren( + ...suggestions.map(({ label }) => { + const button = document.createElement("button"); + button.type = "button"; + button.className = "tag"; + button.textContent = `+ ${label}`; + button.addEventListener("click", () => { + elements.editTagsInput.value = [...typedTags(), label].join(", "); + renderTagSuggestions(); + }); + return button; + }) + ); +} + +// Changements de texte à envoyer : titre, section et étiquettes d'un morceau, nom d'une section. +function editorChanges({ kind, item }) { const changes = {}; - const title = elements.trackTitleInput.value.trim(); - if (title && title !== (track.title || track.originalName)) changes.title = title; - const sectionId = elements.trackSectionSelect.value || null; - if (sectionId !== (track.sectionId ?? null)) changes.sectionId = sectionId; - const coverFile = elements.trackCoverInput.files[0]; + const name = elements.editNameInput.value.trim(); + if (kind === "section") { + if (name && name !== item.name) changes.name = name; + return changes; + } + if (name && name !== (item.title || item.originalName)) changes.title = name; + const sectionId = elements.editSectionSelect.value || null; + if (sectionId !== (item.sectionId ?? null)) changes.sectionId = sectionId; + const tags = typedTags(); + if (tags.join("\n") !== (item.tags ?? []).join("\n")) changes.tags = tags; + return changes; +} + +async function saveEditor(event) { + event.preventDefault(); + if (!editing) return; + const { kind, item } = editing; + const path = kind === "track" ? `/library/${item.id}` : `/library/sections/${item.id}`; + const changes = editorChanges(editing); + const coverFile = elements.editCoverInput.files[0]; try { - await withBusyButton(elements.trackSaveBtn, async () => { + await withBusyButton(elements.editSaveBtn, async () => { if (Object.keys(changes).length > 0) { - await apiFetch(`/library/${track.id}`, { method: "PATCH", body: changes }); + await apiFetch(path, { method: "PATCH", body: changes }); } if (coverFile) { const data = new FormData(); data.append("cover", coverFile); - await apiFetch(`/library/${track.id}/cover`, { method: "PUT", body: data }); - } else if (removeCover && track.coverUrl) { - await apiFetch(`/library/${track.id}/cover`, { method: "DELETE" }); + await apiFetch(`${path}/cover`, { method: "PUT", body: data }); + } else if (removeCover && item.coverUrl) { + await apiFetch(`${path}/cover`, { method: "DELETE" }); } }); - elements.trackDialog.close(); + elements.editDialog.close(); if (!state.live) await refreshLibrary(); } catch (error) { // La fenêtre reste ouverte : la personne peut corriger (autre image…) et réessayer. @@ -1019,12 +1157,13 @@ function bindEvents() { elements.newSectionBtn.addEventListener("click", () => createSection(elements.newSectionBtn)); elements.permanentCheckbox.addEventListener("change", renderSectionChoices); - elements.trackForm.addEventListener("submit", saveTrackEditor); - elements.trackCancelBtn.addEventListener("click", () => elements.trackDialog.close()); - elements.trackCoverInput.addEventListener("change", previewChosenCover); - elements.trackCoverRemoveBtn.addEventListener("click", clearChosenCover); - elements.trackDialog.addEventListener("close", () => { - editedTrack = null; + elements.editForm.addEventListener("submit", saveEditor); + elements.editCancelBtn.addEventListener("click", () => elements.editDialog.close()); + elements.editCoverInput.addEventListener("change", previewChosenCover); + elements.editTagsInput.addEventListener("input", renderTagSuggestions); + elements.editCoverRemoveBtn.addEventListener("click", clearChosenCover); + elements.editDialog.addEventListener("close", () => { + editing = null; }); elements.enqueueAllBtn.addEventListener("click", () => enqueueAll(false, elements.enqueueAllBtn) diff --git a/public/style/styles.css b/public/style/styles.css index f6a0a8a..6e0b4ec 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -597,18 +597,19 @@ a.btn { /* Pochette d'un morceau : , ou
      vide (note de musique) ou à image de fond (aperçu). */ .cover { flex-shrink: 0; - width: 48px; - height: 48px; - border-radius: 10px; + width: 72px; + height: 72px; + border-radius: 12px; object-fit: cover; background: var(--surface-soft) center / cover no-repeat; border: 1px solid var(--border); } +/* Lecteur et fenêtre de modification. */ .cover--large { - width: 96px; - height: 96px; - border-radius: 14px; + width: 160px; + height: 160px; + border-radius: 18px; } .cover--empty { @@ -618,16 +619,16 @@ a.btn { &::after { content: "♪"; - font-size: 1.4rem; + font-size: 1.8rem; } &.cover--large::after { - font-size: 2.4rem; + font-size: 3.5rem; } } /* ------------------------------------------------------------------------------------------------ - * Bibliothèque : sections repliables et fenêtre de modification d'un morceau + * Bibliothèque : sections repliables et fenêtre de modification (morceau ou section) */ .library { @@ -648,9 +649,8 @@ a.btn { .library-section__summary { display: flex; - align-items: baseline; - flex-wrap: wrap; - gap: 0.25rem 0.75rem; + align-items: center; + gap: 0.75rem; padding: 0.85rem 0; cursor: pointer; list-style: none; @@ -670,6 +670,72 @@ a.btn { } } +/* Nom et nombre de morceaux : restent à côté de l'image, quitte à passer sur deux lignes. */ +.library-section__heading { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 0.25rem 0.75rem; + min-width: 0; +} + +/* Étiquettes : sous un morceau, en barre de filtre au-dessus de la bibliothèque, ou en + suggestions dans la fenêtre de modification. Celle du filtre actif est pressée. */ +.tag-list { + display: flex; + flex-wrap: wrap; + gap: 0.35rem; + + &:not(:empty) { + margin-top: 0.4rem; + } +} + +.tag-list--filter:not(:empty) { + margin-top: 0.75rem; +} + +.tag { + display: inline-flex; + align-items: center; + gap: 0.35rem; + padding: 0.2rem 0.7rem; + border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); + border-radius: 999px; + background: color-mix(in srgb, var(--accent) 15%, transparent); + color: var(--text); + font: inherit; + font-size: 0.8rem; + cursor: pointer; + + &:hover { + background: color-mix(in srgb, var(--accent) 30%, transparent); + } + + &[aria-pressed="true"] { + background: var(--accent-gradient); + color: var(--on-accent); + border-color: transparent; + } + + &:focus-visible { + outline: 2px solid #fff; + outline-offset: 2px; + } +} + +.tag__count { + opacity: 0.7; + font-size: 0.75rem; +} + +/* Image de la section, entre la flèche et le nom. */ +.cover--section { + width: 96px; + height: 96px; + border-radius: 14px; +} + .library-section__name { font-weight: 600; font-size: 1.05rem; @@ -708,13 +774,13 @@ a.btn { } } -.track-editor { +.cover-editor { display: flex; gap: 1rem; align-items: flex-start; } -.track-editor__cover-fields { +.cover-editor__fields { flex: 1; min-width: 0; } @@ -819,10 +885,21 @@ a.btn { flex-basis: 100%; } - .track-editor { + .cover-editor { flex-direction: column; } + .cover { + width: 60px; + height: 60px; + } + + .cover--large, + .cover--section { + width: 96px; + height: 96px; + } + .media-item__actions .btn, .library-section__toolbar .btn { width: auto; diff --git a/src/features/tags.js b/src/features/tags.js new file mode 100644 index 0000000..042881d --- /dev/null +++ b/src/features/tags.js @@ -0,0 +1,42 @@ +/** + * @file Étiquettes des morceaux de la bibliothèque : nettoyage de la liste envoyée par la page et + * comparaison sans tenir compte des majuscules. + * + * Utilisé par : web/routes/library.js (modification d'un morceau, ajout à la file par étiquette). + * Attention : la virgule sépare les étiquettes dans la page ; elle est donc retirée d'une étiquette. + * « Calme » et « calme » sont la même étiquette : la première écriture reçue est gardée. + */ + +const MAX_TAGS = 15; +const MAX_TAG_LENGTH = 30; + +// Clé de comparaison d'une étiquette. +function tagKey(tag) { + return String(tag).toLocaleLowerCase("fr"); +} + +// Liste d'étiquettes propre (sans doublon, ni vide, ni caractère de contrôle), ou null si +// `value` n'est pas un tableau. +function cleanTags(value) { + if (!Array.isArray(value)) return null; + const tags = new Map(); + for (const raw of value) { + const tag = String(raw ?? "") + .replace(/[\u0000-\u001f,]/g, " ") + .replace(/\s+/g, " ") + .trim() + .slice(0, MAX_TAG_LENGTH) + .trim(); + if (tag && !tags.has(tagKey(tag))) { + tags.set(tagKey(tag), tag); + } + } + return [...tags.values()].slice(0, MAX_TAGS); +} + +function hasTag(entry, tag) { + const key = tagKey(tag); + return (entry.tags ?? []).some((item) => tagKey(item) === key); +} + +export { cleanTags, hasTag }; diff --git a/src/web/routes/coverUpload.js b/src/web/routes/coverUpload.js new file mode 100644 index 0000000..f6d19af --- /dev/null +++ b/src/web/routes/coverUpload.js @@ -0,0 +1,41 @@ +/** + * @file Réception d'une image envoyée depuis la page (pochette d'un morceau, image d'une section) : + * middleware d'envoi et traitement commun aux deux routes. + * + * Utilisé par : web/routes/library.js et librarySections.js. + * Attention : le fichier reçu dans storage/temp est toujours supprimé, que l'image soit acceptée ou + * non ; seule sa conversion reste, dans storage/covers. + */ + +import multer from "multer"; +import { saveCoverFromImage } from "../storage/libraryCovers.js"; +import { deleteCoverFile, discardUploadedFile, TEMP_DIR } from "../storage/storageManager.js"; + +const MAX_COVER_SIZE = 10 * 1024 * 1024; + +// Champ « cover », une seule image. +const coverUpload = multer({ + dest: TEMP_DIR, + limits: { fileSize: MAX_COVER_SIZE, files: 1, fields: 0 }, +}).single("cover"); + +// Convertit l'image reçue, puis apply(nom) l'attache à son élément et renvoie la réponse JSON, +// ou null si l'élément n'existe plus (404, la nouvelle image est alors supprimée). +async function handleCoverUpload(req, res, apply) { + if (!req.file) { + return res.status(400).json({ error: "Aucune image reçue" }); + } + try { + const cover = await saveCoverFromImage(req.file.path); + const body = apply(cover); + if (!body) { + deleteCoverFile(cover); + return res.status(404).json({ error: "Élément introuvable" }); + } + return res.json(body); + } finally { + discardUploadedFile(req.file); + } +} + +export { coverUpload, handleCoverUpload }; diff --git a/src/web/routes/library.js b/src/web/routes/library.js index bb00b72..6469426 100644 --- a/src/web/routes/library.js +++ b/src/web/routes/library.js @@ -1,6 +1,7 @@ /** * @file Routes /api/library : liste la bibliothèque et ses sections, modifie un morceau (titre, - * section, pochette), le supprime, et ajoute à la file un morceau, une section ou tout. + * section, étiquettes, pochette), le supprime, et ajoute à la file un morceau, ou tous ceux + * d'une section et/ou d'une étiquette. * * Utilisé par : web/server.js ; appelé par la page du jukebox. * Attention : chaque changement émet « libraryUpdate » sur la file, que le flux /api/events relaie @@ -8,27 +9,21 @@ */ import { Router } from "express"; -import multer from "multer"; -import { saveCoverFromImage, setTrackCover } from "../storage/libraryCovers.js"; +import { setTrackCover } from "../storage/libraryCovers.js"; import { findSection, getSections } from "../storage/librarySections.js"; import { createQueueTrackFromLibrary, deletePermanentTrack, - discardUploadedFile, findPermanentTrack, getPermanentLibrary, - TEMP_DIR, updatePermanentTracks, } from "../storage/storageManager.js"; -import { serializeTrack, serializeTracks } from "../serializers.js"; +import { serializeSections, serializeTrack, serializeTracks } from "../serializers.js"; +import { cleanTags, hasTag } from "../../features/tags.js"; import { shuffle } from "../../features/utilities.js"; +import { coverUpload, handleCoverUpload } from "./coverUpload.js"; import { librarySectionsRouter } from "./librarySections.js"; -const coverUpload = multer({ - dest: TEMP_DIR, - limits: { fileSize: 10 * 1024 * 1024, files: 1, fields: 0 }, -}); - function cleanTitle(value) { return String(value ?? "") .replace(/[\u0000-\u001f]/g, "") @@ -41,7 +36,10 @@ function libraryRouter({ queue }) { router.use("/sections", librarySectionsRouter({ queue })); router.get("/", (req, res) => { - res.json({ tracks: serializeTracks(getPermanentLibrary()), sections: getSections() }); + res.json({ + tracks: serializeTracks(getPermanentLibrary()), + sections: serializeSections(getSections()), + }); }); router.delete("/:libraryId", (req, res) => { @@ -56,7 +54,7 @@ function libraryRouter({ queue }) { res.json({ removed: serializeTrack(track) }); }); - // Corps : title et/ou sectionId (null : sans section). + // Corps : title, sectionId (null : sans section) et/ou tags (liste complète, [] pour aucune). router.patch("/:libraryId", (req, res) => { const fields = {}; if (req.body?.title !== undefined) { @@ -72,6 +70,12 @@ function libraryRouter({ queue }) { } fields.sectionId = sectionId; } + if (req.body?.tags !== undefined) { + fields.tags = cleanTags(req.body.tags); + if (!fields.tags) { + return res.status(400).json({ error: "Les étiquettes doivent être une liste" }); + } + } if (Object.keys(fields).length === 0) { return res.status(400).json({ error: "Rien à modifier" }); } @@ -89,25 +93,14 @@ function libraryRouter({ queue }) { }); // Remplace la pochette par l'image envoyée (champ « cover »). - router.put("/:libraryId/cover", coverUpload.single("cover"), async (req, res) => { - if (!req.file) { - return res.status(400).json({ error: "Aucune image reçue" }); - } - try { - if (!findPermanentTrack(req.params.libraryId)) { - return res.status(404).json({ error: "Fichier permanent introuvable" }); - } - const cover = await saveCoverFromImage(req.file.path); + router.put("/:libraryId/cover", coverUpload, (req, res) => + handleCoverUpload(req, res, (cover) => { const track = setTrackCover(req.params.libraryId, cover); - if (!track) { - return res.status(404).json({ error: "Fichier permanent introuvable" }); - } + if (!track) return null; queue.emit("libraryUpdate"); - res.json({ track: serializeTrack(track) }); - } finally { - discardUploadedFile(req.file); - } - }); + return { track: serializeTrack(track) }; + }) + ); router.delete("/:libraryId/cover", (req, res) => { const track = setTrackCover(req.params.libraryId, null); @@ -119,12 +112,15 @@ function libraryRouter({ queue }) { }); // Ajoute la bibliothèque à la file, mélangée si shuffle vaut true. Avec sectionId, seulement - // cette section (null : les morceaux sans section). + // cette section (null : les morceaux sans section) ; avec tag, seulement cette étiquette. router.post("/enqueue-all", (req, res) => { let entries = getPermanentLibrary(); if (req.body?.sectionId !== undefined) { entries = entries.filter((entry) => (entry.sectionId ?? null) === req.body.sectionId); } + if (typeof req.body?.tag === "string" && req.body.tag) { + entries = entries.filter((entry) => hasTag(entry, req.body.tag)); + } if (req.body?.shuffle === true) { shuffle(entries); } diff --git a/src/web/routes/librarySections.js b/src/web/routes/librarySections.js index a604c74..708a1c5 100644 --- a/src/web/routes/librarySections.js +++ b/src/web/routes/librarySections.js @@ -1,10 +1,17 @@ /** * @file Routes /api/library/sections : crée, renomme, déplace et supprime les sections de la - * bibliothèque. + * bibliothèque, et change leur image. */ import { Router } from "express"; -import { createSection, deleteSection, updateSection } from "../storage/librarySections.js"; +import { + createSection, + deleteSection, + setSectionCover, + updateSection, +} from "../storage/librarySections.js"; +import { serializeSection } from "../serializers.js"; +import { coverUpload, handleCoverUpload } from "./coverUpload.js"; function librarySectionsRouter({ queue }) { const router = Router(); @@ -12,7 +19,7 @@ function librarySectionsRouter({ queue }) { router.post("/", (req, res) => { const section = createSection(req.body?.name); queue.emit("libraryUpdate"); - res.status(201).json({ section }); + res.status(201).json({ section: serializeSection(section) }); }); // Corps : name (nouveau nom) et/ou position (nouvel emplacement, 0 en tête). @@ -26,7 +33,26 @@ function librarySectionsRouter({ queue }) { return res.status(404).json({ error: "Section introuvable" }); } queue.emit("libraryUpdate"); - res.json({ section }); + res.json({ section: serializeSection(section) }); + }); + + // Remplace l'image de la section par celle envoyée (champ « cover »). + router.put("/:sectionId/cover", coverUpload, (req, res) => + handleCoverUpload(req, res, (cover) => { + const section = setSectionCover(req.params.sectionId, cover); + if (!section) return null; + queue.emit("libraryUpdate"); + return { section: serializeSection(section) }; + }) + ); + + router.delete("/:sectionId/cover", (req, res) => { + const section = setSectionCover(req.params.sectionId, null); + if (!section) { + return res.status(404).json({ error: "Section introuvable" }); + } + queue.emit("libraryUpdate"); + res.json({ section: serializeSection(section) }); }); router.delete("/:sectionId", (req, res) => { @@ -35,7 +61,7 @@ function librarySectionsRouter({ queue }) { return res.status(404).json({ error: "Section introuvable" }); } queue.emit("libraryUpdate"); - res.json({ removed: section }); + res.json({ removed: serializeSection(section) }); }); return router; diff --git a/src/web/serializers.js b/src/web/serializers.js index 578a18e..472eded 100644 --- a/src/web/serializers.js +++ b/src/web/serializers.js @@ -1,25 +1,36 @@ /** - * @file Prépare les morceaux pour l'API : retire le chemin et le nom du fichier sur le disque, et - * remplace le nom de la pochette par son adresse. + * @file Prépare les morceaux et les sections de la bibliothèque pour l'API : retire le chemin et le + * nom du fichier sur le disque, et remplace le nom de la pochette ou de l'image par son adresse. * * Utilisé par : music/queue.js (snapshot) et les routes web. * Attention : tout morceau envoyé à une page ou à un client passe par ici. */ +// Remplace le nom de fichier `cover` (storage/covers) par l'adresse coverUrl, servie par +// web/server.js. +function withCoverUrl({ cover, ...item }) { + return cover ? { ...item, coverUrl: `/covers/${encodeURIComponent(cover)}` } : item; +} + function serializeTrack(track) { if (!track) { return null; } - const { path: _path, storedName: _storedName, cover, ...publicTrack } = track; - if (cover) { - publicTrack.coverUrl = `/covers/${encodeURIComponent(cover)}`; - } - return publicTrack; + const { path: _path, storedName: _storedName, ...publicTrack } = track; + return withCoverUrl(publicTrack); } function serializeTracks(tracks = []) { return tracks.map(serializeTrack); } -export { serializeTrack, serializeTracks }; +function serializeSection(section) { + return section ? withCoverUrl(section) : null; +} + +function serializeSections(sections = []) { + return sections.map(serializeSection); +} + +export { serializeSection, serializeSections, serializeTrack, serializeTracks }; diff --git a/src/web/storage/libraryCovers.js b/src/web/storage/libraryCovers.js index ffd6ad5..202a501 100644 --- a/src/web/storage/libraryCovers.js +++ b/src/web/storage/libraryCovers.js @@ -1,9 +1,10 @@ /** * @file Pochettes des morceaux de la bibliothèque : reprise de la pochette intégrée au fichier audio, - * remplacement par une image envoyée depuis la page, retrait. + * remplacement par une image envoyée depuis la page, retrait. Convertit aussi les images des + * sections (saveCoverFromImage). * * Utilisé par : music/ingest.js (nouveau morceau), storage/libraryMetadata.js (morceaux plus - * anciens), web/routes/library.js (envoi et retrait depuis la page). + * anciens), web/routes/library.js (retrait depuis la page), web/routes/coverUpload.js (envoi). * Attention : * - Le champ `cover` d'une entrée vaut le nom du fichier dans storage/covers, null si le morceau * n'a pas de pochette, et il est absent tant que la pochette intégrée n'a pas été cherchée. @@ -11,6 +12,7 @@ * peut garder une pochette en cache indéfiniment (servie sous /covers par web/server.js). */ +import fs from "node:fs"; import path from "node:path"; import { randomUUID } from "node:crypto"; import { createCoverImage, detectImageFormat } from "../../media/coverArt.js"; @@ -29,6 +31,8 @@ function httpError(status, message, cause) { async function writeCover(inputPath, { create = createCoverImage, inputFormat } = {}) { const name = `${randomUUID()}.jpg`; try { + // Le dossier est créé au démarrage du serveur, mais peut avoir été supprimé depuis. + fs.mkdirSync(COVERS_DIR, { recursive: true }); await create(inputPath, path.join(COVERS_DIR, name), { inputFormat }); return name; } catch (error) { diff --git a/src/web/storage/librarySections.js b/src/web/storage/librarySections.js index b1690cf..4b06605 100644 --- a/src/web/storage/librarySections.js +++ b/src/web/storage/librarySections.js @@ -1,17 +1,24 @@ /** - * @file Sections de la bibliothèque : liste ordonnée de groupes nommés, enregistrée dans - * storage/runtime/sections.json. Chaque morceau désigne la sienne par son champ `sectionId`. + * @file Sections de la bibliothèque : liste ordonnée de groupes nommés, avec une image facultative, + * enregistrée dans storage/runtime/sections.json. Chaque morceau désigne la sienne par son + * champ `sectionId`. * * Utilisé par : web/routes/librarySections.js, web/routes/library.js et uploads.js (section * choisie pour un morceau). - * Attention : supprimer une section remet ses morceaux « sans section », sans les supprimer. Un - * fichier absent vaut une liste vide. + * Attention : supprimer une section remet ses morceaux « sans section », sans les supprimer, et + * supprime son image. Un fichier absent vaut une liste vide. L'image (`cover`) est un nom de + * fichier de storage/covers, créé comme les pochettes des morceaux (libraryCovers.js). */ import fs from "node:fs"; import path from "node:path"; import { randomUUID } from "node:crypto"; -import { getPermanentLibrary, RUNTIME_DIR, updatePermanentTracks } from "./storageManager.js"; +import { + deleteCoverFile, + getPermanentLibrary, + RUNTIME_DIR, + updatePermanentTracks, +} from "./storageManager.js"; const SECTIONS_FILE = path.join(RUNTIME_DIR, "sections.json"); const MAX_SECTIONS = 100; @@ -99,9 +106,35 @@ function deleteSection(id) { const [removed] = sections.splice(index, 1); writeSections(sections); + deleteCoverFile(removed.cover); const orphans = getPermanentLibrary().filter((entry) => entry.sectionId === id); updatePermanentTracks(new Map(orphans.map((entry) => [entry.id, { sectionId: null }]))); return removed; } -export { createSection, deleteSection, findSection, getSections, updateSection }; +// Donne l'image `name` (null : aucune) à la section et supprime l'ancienne. Renvoie la section, +// ou null si elle n'existe plus : la nouvelle image est alors supprimée. +function setSectionCover(id, name) { + const sections = getSections(); + const section = sections.find((item) => item.id === id); + if (!section) { + deleteCoverFile(name); + return null; + } + const previous = section.cover; + section.cover = name; + writeSections(sections); + if (previous && previous !== name) { + deleteCoverFile(previous); + } + return section; +} + +export { + createSection, + deleteSection, + findSection, + getSections, + setSectionCover, + updateSection, +}; diff --git a/test/librarySections.test.js b/test/librarySections.test.js index a67be16..760b95f 100644 --- a/test/librarySections.test.js +++ b/test/librarySections.test.js @@ -1,6 +1,6 @@ /** - * @file Vérifie les sections de la bibliothèque : création, renommage, déplacement, et suppression qui - * remet ses morceaux sans section. + * @file Vérifie les sections de la bibliothèque : création, renommage, déplacement, image, et + * suppression qui remet ses morceaux sans section. */ import test from "node:test"; @@ -15,6 +15,7 @@ const temporaryDirectory = fs.mkdtempSync(path.join(os.tmpdir(), "palico-section process.chdir(temporaryDirectory); const storage = await import("../src/web/storage/storageManager.js"); const sections = await import("../src/web/storage/librarySections.js"); +const { serializeSection } = await import("../src/web/serializers.js"); storage.ensureStorageLayout(); test.after(() => { process.chdir(originalDirectory); @@ -66,3 +67,25 @@ test("deleting a section keeps its tracks, without a section", () => { assert.equal(storage.findPermanentTrack(inKept).sectionId, kept.id); assert.equal(sections.deleteSection(doomed.id), null); }); + +test("a section image is replaced, removed, and deleted with its section", () => { + const section = sections.createSection("Avec image"); + const coverFile = (name) => path.join(storage.COVERS_DIR, name); + fs.writeFileSync(coverFile("first.jpg"), "jpeg"); + fs.writeFileSync(coverFile("second.jpg"), "jpeg"); + + sections.setSectionCover(section.id, "first.jpg"); + assert.equal(serializeSection(sections.findSection(section.id)).coverUrl, "/covers/first.jpg"); + assert.equal("cover" in serializeSection(sections.findSection(section.id)), false); + + sections.setSectionCover(section.id, "second.jpg"); + assert.equal(fs.existsSync(coverFile("first.jpg")), false); + + // Section disparue : la nouvelle image est supprimée au lieu de rester orpheline. + fs.writeFileSync(coverFile("orphan.jpg"), "jpeg"); + assert.equal(sections.setSectionCover("unknown", "orphan.jpg"), null); + assert.equal(fs.existsSync(coverFile("orphan.jpg")), false); + + sections.deleteSection(section.id); + assert.equal(fs.existsSync(coverFile("second.jpg")), false); +}); diff --git a/test/tags.test.js b/test/tags.test.js new file mode 100644 index 0000000..3c94cc0 --- /dev/null +++ b/test/tags.test.js @@ -0,0 +1,29 @@ +/** + * @file Vérifie le nettoyage des étiquettes (espaces, virgules, doublons, limites) et leur comparaison + * sans tenir compte des majuscules. + */ + +import test from "node:test"; +import assert from "node:assert/strict"; +import { cleanTags, hasTag } from "../src/features/tags.js"; + +test("tags are trimmed, deduplicated and kept in their first spelling", () => { + assert.deepEqual( + cleanTags([" Épique ", "calme", "épique", "", "a,b", "Monster\u0007 Hunter", null]), + ["Épique", "calme", "a b", "Monster Hunter"] + ); + assert.deepEqual(cleanTags([]), []); + assert.equal(cleanTags("épique, calme"), null); +}); + +test("tags are limited in number and length", () => { + const many = Array.from({ length: 20 }, (_, index) => `tag${index}`); + assert.equal(cleanTags(many).length, 15); + assert.equal(cleanTags(["x".repeat(50)])[0].length, 30); +}); + +test("tag matching ignores case", () => { + assert.equal(hasTag({ tags: ["Épique"] }, "épique"), true); + assert.equal(hasTag({ tags: ["calme"] }, "épique"), false); + assert.equal(hasTag({}, "épique"), false); +}); From 5ca0575ccaaf3e276b04ffefadbbd2d7759026ab Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 1 Dec 2026 23:41:59 +0100 Subject: [PATCH 5/7] Redraw the favicon as a flat sticker-style cat The detailed illustration turned to mush at tab size. The new icon is a flat SVG with a bold outline and big eyes, plus 32 px PNG and Apple touch icon fallbacks rendered from it. Co-Authored-By: Claude Opus 5.5 --- public/img/apple-touch-icon.png | Bin 80753 -> 20808 bytes public/img/favicon.png | Bin 11970 -> 1990 bytes public/img/favicon.svg | 43 ++++++++++++++++++++++++++++++++ public/index.html | 3 ++- public/jukebox.html | 3 ++- 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 public/img/favicon.svg diff --git a/public/img/apple-touch-icon.png b/public/img/apple-touch-icon.png index ca6ea21a15b4f8e2aa1474626ba21dbe25c635c5..81014dc857389a8850b1d22f79c7e61da50d8e5a 100644 GIT binary patch literal 20808 zcmaI8by$@D);+AEAjp7%7^IQ{BI3{~4kF!1gMbdr&>bo;2oe$l3^CH(-AKqtBi%64 zJ#@o+4}Q-%&v|~&_5Pt;D06>e$69;seG{Oh@CHOgNp$7P6_B))gbMJr6!+&QKJd3l z7ygSYSCmPmCB)TS;@1-hKE78+p1}&<$2@)_AQj&E>*HK0V?a0)A)A2D^Xqr6OUr07 z%G|zs5PIzzLvrFHv)5PsD889WNW94TLHuyy==)B>NuB$2&Hg9Q6}or;`{ z>;|v16?Mn1UTymg@MGV{9=9_=QlB*P?LM{3kmG@s=zG*#D5Qy*%wClZuxd0D@QJBJ zw_Nv_OYFO%5>}wvZjxKv*Ybln(j}ZMt}!v@bsGC%X8o0KC+(5R(A7xYc~)_&m&A(s z4%WTa1>pRz6xcZ#G!)Os#SWoUY)aPKd!nH9^(D{8$ox6B`-( zYW=hLGU^Wt<)~$MT}8yF zt^sR*^$liIWHm2WXj8vjlQ&y9Ept-eL^mUl>hHh&J@_>vNQ$)O%b>^@=~(e%Q=@nI zGILdZ989cPUo42S)vKQMilsXLNznSa87YyCNToLjPQ9AypxDWHdE(6YfJofIzRGCW zA$9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nDDU1hF?HO zb9Oe5<>kS8X#WZ@$yV8&R{-Fe#9Ct$3oeGGyly{yh)=32%=$6wH}c-hgW)mD{S)Id z)?6p&7CYoa{Qifh$Mta^ccI%~a9Y%v32i{&c-tE|IrtQWckn(zOs)KNE~WoXt^tCv zeAY7aVz&xo&rFsWPpoRd<`3v2sQHwu>fBSWI6Ip&x0wNCaT(*xosfQG%^?`UIAr0F z`X8RKpWawj;vx}!f%{2tfAjFTtW5PvCYh3n@o5Zj(rr90`9H@Chf1#iCoho-Qnmj;otW3;Va bCCC2-`(z&Cgo(kA00000NkvXXu0mjfE)zyc diff --git a/public/img/favicon.png b/public/img/favicon.png index f5db86404ebb022441642d4040b24b330da3dd47..6efd06902c93c65421bdb559b2a2b9a809cd2b74 100644 GIT binary patch literal 1990 zcmV;%2RZnOP)hozm7Wjznb`p4s69rU z&>S5JGa6+S5G!$DsiermQDg@2-T=LqHz?dY|9x)v3b+i-TK!r3?tRYr_Wpi*?{9zS zAYp(E216(-NRm{_>POS<#_b0{qnY(}wb^XK(`!Tmjnmn@XK~!M9CsZkjysFv9$-_} zK!9U04~I`~Y1UyyQVM21HG3zGBlu1di&->2 z7JR>IGMlpA*pzlp5FF3!+@!Kml?=gIM5*m0;5=WDJF3Sb}r1i+eC9!Eo)6;^KgScZ6I z@luv0r8J9_BuU5m7O}g6Rl!>+YeF+KK9rqrT>d=V?R${C^>Y(|j{Ti!C+m9w+LSTq z{a*n#Z23ECG_7J4#A=k%G*TJ>!LABc1)Oy#XAf_s1J)(Rp;z@V>@~T40l>ayzvhMz z2e}16$WnbA>r!|3h0ySJK8pv7&=r;_I#&*KE_BBL&CNQ)giwEk`@19Y#owUAbt3N? zB_LM4orx<=?QnH-htJ4Syn9oZFI_}aV*@-~?XY3l9J6yF+orGa#=Cn42PiK3+7SP2 zEM`ZJ!V|M%(WUq$Iy%~M^zaurntKTCo!zt=Ty{3rm=g0Src8SbwzhT{s`~~9v$L?b z;36_U$wGLY1hqr-vhw-3oSW$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W%vTMY~));CcHg!I@rz(oe zd)Z7~SfbHeF+b6dmX;2T_I0AMt`4PTH7GByL2YFPR;Jq!v>X4mxvU^E)?TUkzZw=7 URj1QxY5)KL07*qoM6N<$f=EI?6#xJL diff --git a/public/img/favicon.svg b/public/img/favicon.svg new file mode 100644 index 0000000..1d7500f --- /dev/null +++ b/public/img/favicon.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/index.html b/public/index.html index 7d47b6b..3519f66 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,8 @@ - + + diff --git a/public/jukebox.html b/public/jukebox.html index ef2fef1..35e443c 100644 --- a/public/jukebox.html +++ b/public/jukebox.html @@ -5,7 +5,8 @@ Palico Jukebox - + + From d14cc414b54f37d3e951ffa285c1f6412c35a7a6 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Wed, 2 Dec 2026 11:32:08 +0100 Subject: [PATCH 6/7] Fix unreadable dropdowns and tidy the jukebox page on phones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Section dropdowns had a transparent background and white text: Chrome on Windows drew their options on white, so they could not be read. Selects and their options now get a solid dark background. Also style the file picker button and checkboxes, keep the drag-and-drop badge on one line, and on phones shrink the illustration, lay the player buttons out on two columns and fit track and section buttons on fewer lines. Dates are shown in short French ("2 déc. 2026, 11:24"). Co-Authored-By: Claude Opus 5.5 --- public/scripts/common.js | 10 +++--- public/style/styles.css | 70 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/public/scripts/common.js b/public/scripts/common.js index a08fe48..24a47f6 100644 --- a/public/scripts/common.js +++ b/public/scripts/common.js @@ -115,13 +115,13 @@ export function formatDuration(seconds) { : `${minutes}:${secs}`; } +// Date courte en français, sans les secondes : « 2 déc. 2026, 11:24 ». +const DATE_FORMAT = new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium", timeStyle: "short" }); + export function formatDate(value) { if (!value) return "?"; - try { - return new Date(value).toLocaleString(); - } catch (_) { - return value; - } + const date = new Date(value); + return Number.isNaN(date.getTime()) ? String(value) : DATE_FORMAT.format(date); } export function createApiClient({ getApiKey, basePath = "" } = {}) { diff --git a/public/style/styles.css b/public/style/styles.css index 6e0b4ec..79cb218 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -30,6 +30,9 @@ --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.12); --surface-strong: rgba(255, 255, 255, 0.15); + /* Fond plein des listes déroulantes : le navigateur ne sait pas dessiner leurs options sur un + fond transparent et les met sur du blanc, sous un texte blanc. */ + --bg-raised: #21172f; --shadow: rgba(2, 0, 8, 0.45); --gradient: radial-gradient(circle at 20% 20%, #2d1a49, transparent 45%), radial-gradient(circle at 80% 0%, #551e8c, transparent 40%), @@ -69,6 +72,8 @@ body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; background: var(--gradient), var(--bg); color: var(--text); + /* Cases à cocher et barres de progression natives aux couleurs du site. */ + accent-color: var(--accent); } main { @@ -219,6 +224,7 @@ p { color: var(--accent); border-radius: 12px; font-size: 0.85rem; + white-space: nowrap; } /* ------------------------------------------------------------------------------------------------ @@ -248,8 +254,38 @@ textarea { font-size: 1rem; } +select { + background-color: var(--bg-raised); + cursor: pointer; +} + +select option, +select optgroup { + background-color: var(--bg-raised); + color: var(--text); +} + input[type="file"] { padding: 0.5rem; + color: var(--muted); + cursor: pointer; + + &::file-selector-button { + margin-right: 0.75rem; + padding: 0.4rem 1rem; + border: none; + border-radius: 999px; + background: var(--surface-strong); + color: var(--text); + font: inherit; + font-size: 0.9rem; + font-weight: 600; + cursor: pointer; + } + + &:hover::file-selector-button { + background: color-mix(in srgb, var(--accent) 35%, transparent); + } } input:focus, @@ -861,11 +897,31 @@ a.btn { width: 100%; } - .control-group, + /* L'illustration ne doit pas occuper tout le premier écran. */ + .hero .hero__visual img { + max-width: 150px; + } + + .hero { + padding: 1.5rem 1rem; + gap: 1rem; + } + .url-form__row { flex-direction: column; } + /* Boutons du lecteur sur deux colonnes ; « Stop & vider la file » seul en bas, à l'écart. */ + .control-group { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 0.5rem; + + & .btn--danger { + grid-column: 1 / -1; + } + } + .upload-list__item { grid-template-columns: 1fr; gap: 0.25rem; @@ -900,9 +956,21 @@ a.btn { height: 96px; } + /* Boutons resserrés : « Ajouter, Modifier, Supprimer » tiennent sur une ligne. */ .media-item__actions .btn, .library-section__toolbar .btn { width: auto; flex: 1; + padding-inline: 0.5rem; + white-space: nowrap; + } + + /* Flèches de déplacement à leur taille, sans s'étirer sur la ligne. */ + .library-section__toolbar .btn:is([data-action="up"], [data-action="down"]) { + flex: 0 0 2.75rem; + } + + .panel { + padding: 1.25rem; } } From 25f22dd363a4ca277bf12d684ea059586f194190 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Wed, 2 Dec 2026 12:04:03 +0100 Subject: [PATCH 7/7] 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 --- README.md | 8 +- public/index.html | 280 ++++++- public/jukebox.html | 304 ------- public/scripts/common.js | 18 +- public/scripts/jukebox.js | 336 ++++++-- public/style/styles.css | 1611 +++++++++++++++++++++++-------------- src/music/queue.js | 20 +- src/web/routes/auth.js | 4 +- src/web/routes/player.js | 15 +- src/web/server.js | 8 +- test/discordAuth.test.js | 6 +- test/musicQueue.test.js | 22 +- test/webServer.test.js | 34 +- 13 files changed, 1615 insertions(+), 1051 deletions(-) delete mode 100644 public/jukebox.html diff --git a/README.md b/README.md index 40d63ee..3d09787 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,9 @@ Variables facultatives : ## Jukebox -La page `/jukebox` et les commandes `/play`, `/skip` et `/queue` pilotent la même -file d'attente. +La page d'accueil du site (`/`) et les commandes `/play`, `/skip` et `/queue` +pilotent la même file d'attente. L'ancienne adresse `/jukebox/` redirige vers +`/`. - `/play fichier:` (pièce jointe), `/play lien:` (lien direct vers un fichier audio) ou `/play morceau:` (bibliothèque, avec autocomplétion) ; l'option @@ -125,6 +126,9 @@ file d'attente. 30 s. - La page web reçoit les changements en direct par `GET /api/events` (Server-Sent Events, même clé que le reste de l'API). +- La barre de position du lecteur permet d'avancer ou de reculer dans le + morceau en cours (`POST /api/player/seek`, `{ "position": }`) : + ffmpeg repart de cette position. En pause, la lecture reprend. ### Connexion avec Discord diff --git a/public/index.html b/public/index.html index 3519f66..a925193 100644 --- a/public/index.html +++ b/public/index.html @@ -2,41 +2,277 @@ - Palico Bot + Palico Jukebox - - + + -
      -
      - Palico Bot +
      +
      + + + Palico Jukebox + + +
      +
      -
      -

      Palico Bot

      -

      Bienvenue sur la webapp

      -

      - Lance de la musique sur le Discord et pilote la playlist du salon vocal. + +

      + +
      + + + +
      +
      +
      +
      +

      Bibliothèque

      +

      Les morceaux conservés, rangés en sections.

      +
      + +
      +
      + + +
      + + + +
      +
      + +
      +

      Aucun fichier permanent enregistré.

      +
      + +
      +

      Ajouter de la musique

      +

      + Fichiers audio (150 Mo au plus chacun) ou lien direct vers un fichier. Les morceaux + temporaires sont supprimés après lecture. +

      + +
      + + +
      + + + +
      + + + + + + +
      + +
      +
      + +
        + +
        + +
        + + +
        +

        YouTube et Spotify ne sont pas pris en charge.

        +
        +
        +
        +
        + + + -
        -
        -
        - -

        Le Jukebox du Palico Bot

        -

        - Upload, gère et pilote la playlist du salon vocal en direct. -

        -
        + + + +
        +

        Modifier le morceau

        + +
        + +
        + + +

        PNG, JPEG, WebP ou GIF, 10 Mo au plus. Réduite à 512 px.

        + +
        -
        -
        + + + + +
        + + +
        + +
        + + +

        Sépare-les par des virgules. Clique sur une étiquette existante pour l'ajouter.

        +
        +
        + +
        + + +
        + +
        + + diff --git a/public/jukebox.html b/public/jukebox.html deleted file mode 100644 index 35e443c..0000000 --- a/public/jukebox.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - Palico Jukebox - - - - - - - - -
        -
        - Palico Jukebox -
        -
        -

        Le Jukebox du Palico Bot

        -

        Un peu de son pour le Discord !

        -

        - Tu veux chill avec les autres sur un petit fond musical ?
        - T'inquiète pas, je peux m'occuper de ça !
        -
        - Ajoute des morceaux et gère la playlist depuis cette page, ou avec - /play sur Discord. Tout est synchronisé avec le salon vocal. -

        -
        - - -
        -
        - -
        -
        -

        Connexion

        - - - - - - -
        -
        -
        - -
        - - -
        -
        -
        -

        Lecture en cours

        -

        État du player Discord, mis à jour en direct.

        -
        - Hors ligne -
        -
        - En attente de lecture... -
        - -
        - - - - - - -
        -
        - -
        -
        -
        -

        File d'attente

        -

        - Réorganise les morceaux, supprime-les ou ajoute ceux de la - bibliothèque. -

        -
        - -
        -
          -

          Aucun morceau en attente.

          -
          - -
          -
          -
          -

          Bibliothèque permanente

          -

          - Les fichiers conservés sont listés ici. Range-les en sections, - donne-leur une image, ajoute-les à la file. -

          -
          -
          - - - -
          -
          - - - -
          -

          Aucun fichier permanent enregistré.

          -
          - - -
          -

          Modifier le morceau

          - -
          - -
          - - -

          PNG, JPEG, WebP ou GIF, 10 Mo au plus. Réduite à 512 px.

          - -
          -
          - - - - -
          - - -
          - -
          - - -

          Sépare-les par des virgules. Clique sur une étiquette existante pour l'ajouter.

          -
          -
          - -
          - - -
          -
          -
          - -
          -
          -
          -

          Ajouter de la musique

          -

          - Fichiers audio (150 Mo au plus chacun) ou lien direct vers un - fichier. Les morceaux temporaires sont supprimés après lecture. -

          -
          -
          Glisser-déposer accepté
          -
          - -
          - - -
          - - - -
          - - - - - - - -
          - -
            - -
            - -
            - - -
            -

            YouTube et Spotify ne sont pas pris en charge.

            -
            -
            -
            - - - - - - diff --git a/public/scripts/common.js b/public/scripts/common.js index 24a47f6..b459a5b 100644 --- a/public/scripts/common.js +++ b/public/scripts/common.js @@ -64,7 +64,8 @@ export function createStatusManager(statusElement) { function setStatus(message, type = "info", autoHide = true) { if (!statusElement) return; statusElement.textContent = message; - statusElement.className = `status status--${type}`; + // Le type (info, success, error) passe par un attribut : la classe reste celle de la page. + statusElement.dataset.type = type; statusElement.hidden = false; if (autoHide) { @@ -118,10 +119,21 @@ export function formatDuration(seconds) { // Date courte en français, sans les secondes : « 2 déc. 2026, 11:24 ». const DATE_FORMAT = new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium", timeStyle: "short" }); -export function formatDate(value) { +// Date seule : « 2 déc. 2026 ». +const DAY_FORMAT = new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium" }); + +function formatWith(format, value) { if (!value) return "?"; const date = new Date(value); - return Number.isNaN(date.getTime()) ? String(value) : DATE_FORMAT.format(date); + return Number.isNaN(date.getTime()) ? String(value) : format.format(date); +} + +export function formatDate(value) { + return formatWith(DATE_FORMAT, value); +} + +export function formatDay(value) { + return formatWith(DAY_FORMAT, value); } export function createApiClient({ getApiKey, basePath = "" } = {}) { diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index 42c544d..5fe8ebb 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -1,13 +1,20 @@ /** - * @file Page du jukebox : connexion (Discord ou mot de passe), lecteur, file d'attente, bibliothèque - * (sections, pochettes) et ajout de morceaux. + * @file Page du jukebox (page d'accueil du site) : écran de connexion (Discord ou mot de passe), puis + * lecteur (position réglable), file d'attente, bibliothèque (sections, pochettes, étiquettes) + * et ajout de morceaux. * * Contexte : servi tel quel au navigateur (module ES, sans compilation) ; ne parle qu'à l'API de * src/web/. * Points d'entrée : initialize (au chargement), connectEvents (flux en direct), refreshAll. - * Utilisé par : public/jukebox.html. - * Dépend de : common.js, et des identifiants des éléments de jukebox.html (objet `elements`). + * Utilisé par : public/index.html. + * Dépend de : common.js, et des identifiants des éléments de index.html (objet `elements`). * Attention : + * - Sans session ni mot de passe, seul l'écran de connexion (#welcome) est affiché ; l'application + * (#app) n'apparaît qu'ensuite. Un mot de passe refusé ramène à l'écran de connexion. + * - Les icônes sont des SVG insérés par icon() : un élément porteur de data-icon reçoit la sienne + * au chargement ; le bouton lecture/pause change d'icône selon l'état. + * - Pendant qu'on fait glisser le curseur de position (state.seeking), l'état reçu ne le déplace + * pas ; la nouvelle position part au serveur quand on le lâche. * - L'état arrive par le flux /api/events ; tant qu'il est coupé, chaque action recharge tout. * - Le flux est lu avec fetch, et non EventSource, qui ne permet pas d'envoyer la clé. * - Connecté avec Discord, la session (cookie) remplace la clé : pas d'en-tête Authorization. @@ -26,7 +33,7 @@ import { createStatusManager, escapeHtml, formatBytes, - formatDate, + formatDay, formatDuration, getStoredApiKey, getStoredDisplayName, @@ -61,6 +68,8 @@ const state = { // Position du morceau en cours (ms) au moment où l'état a été reçu. position: 0, positionReceivedAt: 0, + // Curseur de position tenu par la personne : l'état reçu ne doit pas le déplacer. + seeking: false, live: false, }; @@ -77,15 +86,22 @@ const elements = { rememberKeyCheckbox: $("rememberKey"), displayNameInput: $("displayName"), settingsForm: $("settingsForm"), + welcome: $("welcome"), + app: $("app"), liveIndicator: $("liveIndicator"), + playerSection: $("playerSection"), currentTrack: $("currentTrack"), progress: $("progress"), - progressTrack: $("progressTrack"), - progressBar: $("progressBar"), + seekInput: $("seekInput"), progressElapsed: $("progressElapsed"), progressTotal: $("progressTotal"), - pauseResumeBtn: $("pauseResumeBtn"), + playPauseButtons: document.querySelectorAll(".js-play-pause"), loopBtn: $("loopBtn"), + miniPlayer: $("miniPlayer"), + miniPlayerInfo: $("miniPlayerInfo"), + miniPlayerCover: $("miniPlayerCover"), + miniPlayerTitle: $("miniPlayerTitle"), + miniProgressBar: $("miniProgressBar"), playerButtons: document.querySelectorAll("[data-player-action]"), queueList: $("queueList"), queueEmpty: $("queueEmpty"), @@ -98,9 +114,11 @@ const elements = { enqueueAllBtn: $("enqueueAllBtn"), enqueueAllShuffledBtn: $("enqueueAllShuffledBtn"), uploadSection: $("uploadSection"), + goToUploadBtn: $("goToUploadBtn"), uploadForm: $("uploadForm"), uploadSubmitBtn: document.querySelector("#uploadForm button[type='submit']"), fileInput: $("musicFile"), + dropzoneText: $("dropzoneText"), notesInput: $("uploadNotes"), permanentCheckbox: $("permanentFile"), enqueueCheckbox: $("enqueueFile"), @@ -110,9 +128,6 @@ const elements = { urlForm: $("urlForm"), urlInput: $("musicUrl"), urlSubmitBtn: document.querySelector("#urlForm button[type='submit']"), - heroUploadBtn: $("heroUploadBtn"), - heroQueueBtn: $("heroQueueBtn"), - queueSection: $("queueSection"), editDialog: $("editDialog"), editDialogTitle: $("editDialogTitle"), editForm: $("editForm"), @@ -139,6 +154,44 @@ const apiFetch = createApiClient({ basePath: "/api", getApiKey: apiKeyForRequest const canUseApi = () => Boolean(state.user || state.apiKey); const requesterName = () => state.user?.name || state.displayName || "web-ui"; +// --------------------------------------------------------------------------- +// Icônes (SVG 24×24) : tracés pleins (fill) ou au trait. + +const ICONS = { + play: { fill: true, d: "M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z" }, + pause: { fill: true, d: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }, + next: { fill: true, d: "M5 5.5v13a1 1 0 0 0 1.5.86L15 13.6V18h2.5V6H15v4.4L6.5 4.64A1 1 0 0 0 5 5.5z" }, + shuffle: { d: "M16 3h5v5M4 20 21 3M21 16v5h-5M15 15l6 6M4 4l5 5" }, + loop: { d: "M17 2l4 4-4 4M3 11V9a3 3 0 0 1 3-3h15M7 22l-4-4 4-4M21 13v2a3 3 0 0 1-3 3H3" }, + plus: { d: "M12 5v14M5 12h14" }, + edit: { d: "M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z" }, + trash: { d: "M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v5M14 11v5" }, + up: { d: "m18 15-6-6-6 6" }, + down: { d: "m6 9 6 6 6-6" }, + close: { d: "M18 6 6 18M6 6l12 12" }, + upload: { d: "M12 15V3M7 8l5-5 5 5M5 21h14" }, +}; + +function icon(name) { + const { fill = false, d } = ICONS[name]; + return ``; +} + +// Bouton rond à icône seule : son nom passe par aria-label et l'infobulle. +function iconButton(name, label, { action, extraClass = "", disabled = false } = {}) { + return ``; +} + +// Éléments de la page à icône : data-icon (icône seule) ou data-icon-before (devant le texte). +function renderStaticIcons() { + document.querySelectorAll("[data-icon]").forEach((element) => { + element.innerHTML = icon(element.dataset.icon); + }); + document.querySelectorAll("[data-icon-before]").forEach((element) => { + element.insertAdjacentHTML("afterbegin", icon(element.dataset.iconBefore)); + }); +} + // --------------------------------------------------------------------------- // Chargement de l'état @@ -199,8 +252,11 @@ function handleApiError(error) { renderAuth(); setStatus("Session expirée, reconnecte-toi.", "error", false); } else { - // Inutile d'insister : chaque échec compte dans la limite anti-force brute du serveur. - setStatus("Mot de passe refusé, vérifie-le puis sauvegarde.", "error", false); + // Inutile d'insister : chaque échec compte dans la limite anti-force brute du serveur. Le + // mot de passe reste dans le champ, pour le corriger. + state.apiKey = ""; + renderAuth(); + setStatus("Mot de passe refusé, vérifie-le puis réessaie.", "error", false); } return; } @@ -333,38 +389,54 @@ function coverHtml(url, modifier = "") { : ``; } -function trackMeta(track) { +// Détails d'un morceau de la file. Le morceau en cours n'affiche pas sa position de reprise : elle +// est aussi celle d'un déplacement dans le morceau, et la barre de position la montre déjà. +function trackMeta(track, { queued = true } = {}) { const parts = []; const duration = formatDuration(track.duration); - if (duration) parts.push(duration); + if (duration && queued) parts.push(duration); // Morceau interrompu (connexion perdue, redémarrage) : il reprend à cette position. - if (track.resumeAt > 0) parts.push(`Reprise à ${formatDuration(track.resumeAt)}`); - parts.push(track.permanent ? "Permanent" : "Temporaire"); - if (track.size) parts.push(formatBytes(track.size)); - parts.push(`Ajouté par ${escapeHtml(track.uploader || "inconnu")}`); - return parts.join(" • "); + if (queued && track.resumeAt > 0) parts.push(`reprise à ${formatDuration(track.resumeAt)}`); + if (!track.permanent) parts.push("temporaire"); + parts.push(`ajouté par ${escapeHtml(track.uploader || "inconnu")}`); + const text = parts.join(" • "); + return text.charAt(0).toUpperCase() + text.slice(1); } +const trackTitle = (track) => escapeHtml(track.title || track.originalName); + function renderCurrentTrack() { const track = state.current; if (!track) { - elements.currentTrack.classList.add("player-current--empty"); + elements.currentTrack.classList.add("player__track--empty"); elements.currentTrack.textContent = state.queue.length > 0 - ? "File en attente : appuie sur Play ou rejoins le salon vocal." - : "En attente de lecture..."; - return; + ? "File en attente : appuie sur lecture ou rejoins le salon vocal." + : "Rien en cours. Ajoute un morceau depuis la bibliothèque."; + } else { + elements.currentTrack.classList.remove("player__track--empty"); + elements.currentTrack.innerHTML = ` + ${coverHtml(coverUrlOf(track), "cover--large")} +
            +
            ${trackTitle(track)}
            +
            ${trackMeta(track, { queued: false })}
            +
            + `; } + renderMiniPlayer(); +} - elements.currentTrack.classList.remove("player-current--empty"); - elements.currentTrack.innerHTML = ` - ${coverHtml(coverUrlOf(track), "cover--large")} -
            -
            ${escapeHtml(track.title || track.originalName)}
            -
            ${trackMeta(track)}
            -
            Commencé à ${formatDate(track.startedAt || track.createdAt)}
            -
            - `; +// Mini-lecteur des petits écrans : affiché pendant une lecture, quand le lecteur est hors de vue. +let playerInView = true; + +function renderMiniPlayer() { + const track = state.current; + const visible = Boolean(track) && !playerInView && canUseApi(); + elements.miniPlayer.hidden = !visible; + document.body.classList.toggle("has-mini-player", visible); + if (!track) return; + elements.miniPlayerCover.innerHTML = coverHtml(coverUrlOf(track)); + elements.miniPlayerTitle.innerHTML = trackTitle(track); } function currentPosition() { @@ -373,19 +445,54 @@ function currentPosition() { return state.position + elapsed; } +// Partie jouée du curseur : peinte par la feuille de style d'après --progress. +function paintSeek(seconds, duration) { + const percent = duration ? Math.min(100, (seconds / duration) * 100) : 0; + elements.seekInput.style.setProperty("--progress", `${percent}%`); + elements.seekInput.setAttribute("aria-valuetext", `${formatDuration(seconds)} sur ${formatDuration(duration)}`); + elements.progressElapsed.textContent = formatDuration(seconds); + return percent; +} + function renderProgress() { const duration = state.current?.duration; if (!state.current || !duration) { elements.progress.hidden = true; + elements.miniProgressBar.style.width = "0"; return; } elements.progress.hidden = false; - const seconds = Math.min(currentPosition() / 1000, duration); - const percent = Math.round((seconds / duration) * 100); - elements.progressBar.style.width = `${percent}%`; - elements.progressTrack.setAttribute("aria-valuenow", String(percent)); - elements.progressElapsed.textContent = formatDuration(seconds); elements.progressTotal.textContent = formatDuration(duration); + elements.seekInput.max = String(Math.floor(duration)); + if (state.seeking) return; + const seconds = Math.min(currentPosition() / 1000, duration); + elements.seekInput.value = String(Math.floor(seconds)); + const percent = paintSeek(seconds, duration); + elements.miniProgressBar.style.width = `${percent}%`; +} + +// Envoie la position choisie au curseur. Les flèches du clavier en envoient une par appui : on +// attend un court instant pour n'envoyer que la dernière. +let seekTimeout = null; + +function previewSeek() { + state.seeking = true; + paintSeek(Number(elements.seekInput.value), state.current?.duration); +} + +function commitSeek() { + clearTimeout(seekTimeout); + seekTimeout = setTimeout(async () => { + const position = Number(elements.seekInput.value); + try { + applySnapshot(await apiFetch("/player/seek", { method: "POST", body: { position } })); + } catch (error) { + setStatus(`Impossible de changer de position : ${error.message}`, "error"); + } finally { + state.seeking = false; + renderProgress(); + } + }, 250); } function renderQueue() { @@ -406,13 +513,13 @@ function renderQueue() { li.innerHTML = ` ${coverHtml(coverUrlOf(track))}
            -
            ${index + 1}. ${escapeHtml(track.title || track.originalName)}
            +
            ${index + 1}.${trackTitle(track)}
            ${trackMeta(track)}
            - - - + ${iconButton("up", "Monter", { disabled: index === 0 })} + ${iconButton("down", "Descendre", { disabled: index === state.queue.length - 1 })} + ${iconButton("close", "Retirer de la file", { action: "remove", extraClass: "icon-btn--danger" })}
            `; li.querySelectorAll("button").forEach((button) => { @@ -564,15 +671,17 @@ function renderSection({ section, tracks }, shown, { index, last, searching }) { -
            - - +
            + + ${ section - ? ` - - - ` + ? ` + ${iconButton("edit", "Modifier la section")} + ${iconButton("up", "Monter la section", { disabled: index === 0 })} + ${iconButton("down", "Descendre la section", { disabled: index === last })} + ${iconButton("trash", "Supprimer la section", { action: "delete", extraClass: "icon-btn--danger" })} + ` : "" }
            @@ -604,16 +713,16 @@ function renderTrackList(tracks) { li.innerHTML = ` ${coverHtml(track.coverUrl)}
            -
            ${escapeHtml(track.title || track.originalName)}
            +
            ${trackTitle(track)}
            - ${duration ? `${duration} • ` : ""}${formatBytes(track.size)} • Ajouté le ${formatDate(track.createdAt)} + ${duration ? `${duration} • ` : ""}${formatBytes(track.size)} • ajouté le ${formatDay(track.createdAt)}
            - - - + + ${iconButton("edit", "Modifier le morceau")} + ${iconButton("trash", "Supprimer de la bibliothèque", { action: "delete", extraClass: "icon-btn--danger" })}
            `; li.querySelectorAll(".media-item__actions button").forEach((button) => { @@ -647,27 +756,43 @@ function renderSectionChoices() { state.sections.length === 0 || !elements.permanentCheckbox.checked; } -function renderControls() { +// Action du bouton lecture/pause : pause pendant la lecture, reprise en pause, sinon lancement +// de la file (en attente après un redémarrage ou un départ du bot). +function playPauseAction() { const status = String(state.status).toLowerCase(); - const isPaused = status === "paused" || status === "autopaused"; - const isPlaying = status === "playing" || status === "buffering"; - elements.pauseResumeBtn.textContent = isPaused ? "Reprendre" : "Pause"; - elements.pauseResumeBtn.dataset.playerAction = isPaused ? "resume" : "pause"; - elements.pauseResumeBtn.disabled = !(isPaused || isPlaying); + if (status === "playing" || status === "buffering") return "pause"; + if (status === "paused" || status === "autopaused") return "resume"; + return "play"; +} + +const PLAY_PAUSE_LABELS = { pause: "Pause", resume: "Reprendre", play: "Lecture" }; + +function renderControls() { + const action = playPauseAction(); + for (const button of elements.playPauseButtons) { + button.innerHTML = icon(action === "pause" ? "pause" : "play"); + button.setAttribute("aria-label", PLAY_PAUSE_LABELS[action]); + button.title = PLAY_PAUSE_LABELS[action]; + button.disabled = action === "play" && !state.current && state.queue.length === 0; + } elements.loopBtn.setAttribute("aria-pressed", String(state.loop)); - elements.loopBtn.textContent = state.loop ? "Boucle : oui" : "Boucle : non"; + elements.loopBtn.title = state.loop + ? "Boucle activée : la file rejoue en continu" + : "Boucle : la file rejoue en continu"; } function renderAuth() { - const loggedIn = Boolean(state.user); - elements.loggedIn.hidden = !loggedIn; - elements.discordLogin.hidden = loggedIn || !state.oauthEnabled; + const signedIn = canUseApi(); + elements.welcome.hidden = signedIn; + elements.app.hidden = !signedIn; + elements.liveIndicator.hidden = !signedIn; + elements.loggedIn.hidden = !signedIn; + elements.userName.textContent = state.user?.name || state.displayName || ""; + elements.discordLogin.hidden = !state.oauthEnabled; // Le mot de passe ne sert qu'en secours, quand la connexion Discord est désactivée. Un mot de // passe déjà enregistré dans le navigateur reste envoyé et accepté. - elements.keyLogin.hidden = loggedIn || state.oauthEnabled; - if (loggedIn) { - elements.userName.textContent = state.user.name; - } + elements.keyLogin.hidden = state.oauthEnabled; + renderMiniPlayer(); // Sans connexion Discord, le formulaire du mot de passe est la seule option : déplié. if (!state.oauthEnabled) { elements.keyLogin.open = true; @@ -988,6 +1113,18 @@ function addUploadRow(name) { }; } +const DROPZONE_PROMPT = elements.dropzoneText.innerHTML; + +function renderChosenFiles() { + const files = [...elements.fileInput.files]; + if (files.length === 0) { + elements.dropzoneText.innerHTML = DROPZONE_PROMPT; + return; + } + const names = files.map((file) => file.name).join(", "); + elements.dropzoneText.innerHTML = `${files.length} fichier(s) prêt(s) : ${escapeHtml(names)}`; +} + async function handleUpload(event) { event.preventDefault(); const files = [...elements.fileInput.files]; @@ -1033,6 +1170,7 @@ async function handleUpload(event) { if (succeeded > 0) { elements.uploadForm.reset(); + renderChosenFiles(); } setStatus( `${succeeded} fichier(s) sur ${files.length} envoyé(s)`, @@ -1091,16 +1229,8 @@ function showLoginError() { } function startSession() { - if (!canUseApi()) { - setStatus( - state.oauthEnabled - ? "Connecte-toi avec Discord pour accéder au jukebox." - : "Renseigne le mot de passe pour accéder au jukebox.", - "info", - false - ); - return; - } + renderAuth(); + if (!canUseApi()) return; clearStatus(); void refreshAll(); void connectEvents(); @@ -1116,18 +1246,39 @@ function bindEvents() { state.displayName = elements.displayNameInput.value.trim(); setStoredApiKey(state.apiKey, { remember: elements.rememberKeyCheckbox.checked }); setStoredDisplayName(state.displayName); - setStatus("Paramètres sauvegardés", "success"); startSession(); }); elements.logoutBtn.addEventListener("click", async () => { - await fetch("/auth/logout", { method: "POST" }).catch(() => {}); + if (state.user) { + await fetch("/auth/logout", { method: "POST" }).catch(() => {}); + } state.user = null; + state.apiKey = ""; + setStoredApiKey(""); + elements.apiKeyInput.value = ""; stopEvents(); - renderAuth(); startSession(); }); + elements.playPauseButtons.forEach((button) => { + button.addEventListener("click", async () => { + try { + const snapshot = await withBusyButton(button, () => + apiFetch(`/player/${playPauseAction()}`, { method: "POST" }) + ); + applySnapshot(snapshot); + } catch (error) { + setStatus(`Action impossible : ${error.message}`, "error"); + } finally { + renderControls(); + } + }); + }); + + elements.seekInput.addEventListener("input", previewSeek); + elements.seekInput.addEventListener("change", commitSeek); + elements.playerButtons.forEach((button) => { button.addEventListener("click", async () => { const action = button.dataset.playerAction; @@ -1191,16 +1342,23 @@ function bindEvents() { const files = event.dataTransfer?.files; if (files?.length) { elements.fileInput.files = files; - setStatus(`${files.length} fichier(s) prêt(s) à envoyer`, "info"); + renderChosenFiles(); } }); + elements.fileInput.addEventListener("change", renderChosenFiles); - elements.heroUploadBtn.addEventListener("click", () => - elements.uploadSection.scrollIntoView({ behavior: "smooth" }) - ); - elements.heroQueueBtn.addEventListener("click", () => - elements.queueSection.scrollIntoView({ behavior: "smooth" }) - ); + elements.goToUploadBtn.addEventListener("click", () => { + elements.uploadSection.scrollIntoView({ behavior: "smooth" }); + }); + elements.miniPlayerInfo.addEventListener("click", () => { + elements.playerSection.scrollIntoView({ behavior: "smooth" }); + }); + + // Le mini-lecteur ne s'affiche que quand le lecteur est hors de vue. + new IntersectionObserver(([entry]) => { + playerInView = entry.isIntersecting; + renderMiniPlayer(); + }).observe(elements.playerSection); // Onglet de nouveau visible : le flux a pu être coupé (mise en veille), on le relance. document.addEventListener("visibilitychange", () => { @@ -1212,6 +1370,7 @@ function bindEvents() { } async function initialize() { + renderStaticIcons(); elements.apiKeyInput.value = state.apiKey; elements.displayNameInput.value = state.displayName; elements.rememberKeyCheckbox.checked = isApiKeyRemembered(); @@ -1220,7 +1379,6 @@ async function initialize() { setInterval(renderProgress, 1_000); await loadSession(); - renderAuth(); startSession(); showLoginError(); } diff --git a/public/style/styles.css b/public/style/styles.css index 79cb218..6f0a3f1 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -1,9 +1,12 @@ /* - * Rôle : feuille de style unique du site, pour la page d'accueil (index.html) et la page du jukebox - * (jukebox.html), y compris les éléments créés par public/scripts/jukebox.js. - * Chargé par : public/index.html et public/jukebox.html. + * Rôle : feuille de style unique du site, c'est-à-dire de la page du jukebox (public/index.html), + * y compris les éléments créés par public/scripts/jukebox.js (morceaux, sections, icônes). + * Chargé par : public/index.html. * Attention : servie telle quelle, sans compilation. Les couleurs viennent des variables de :root ; * leurs versions transparentes en dérivent avec color-mix() au lieu d'être recopiées en rgba(). + * Chaque paire texte/fond des variables dépasse un contraste de 4,5 : le vérifier avant d'en + * changer une. La mise en page passe sur deux colonnes à partir de 1000 px ; en dessous, le + * mini-lecteur (.mini-player) prend le relais du lecteur hors de vue. */ /* ------------------------------------------------------------------------------------------------ @@ -12,31 +15,28 @@ :root { color-scheme: dark; - --bg: #050109; - --bg-card: rgba(22, 14, 36, 0.9); - --bg-glass: rgba(42, 25, 66, 0.65); - --text: #f7f1ff; - --muted: #cbc4d5; - --muted-dark: #8c7ea7; - --accent: #b259ff; - --accent-strong: #d66bff; - --accent-gradient: linear-gradient(120deg, var(--accent), var(--accent-strong)); - /* Texte posé sur l'accent (boutons principaux). */ - --on-accent: #08010f; - --danger: #ff4d6d; - --success: #59ffa7; - /* Voiles blancs, du plus léger au plus marqué : fonds de champs, bordures, pastilles, boutons. */ - --surface-soft: rgba(255, 255, 255, 0.05); - --border: rgba(255, 255, 255, 0.08); - --border-strong: rgba(255, 255, 255, 0.12); - --surface-strong: rgba(255, 255, 255, 0.15); - /* Fond plein des listes déroulantes : le navigateur ne sait pas dessiner leurs options sur un - fond transparent et les met sur du blanc, sous un texte blanc. */ - --bg-raised: #21172f; - --shadow: rgba(2, 0, 8, 0.45); - --gradient: radial-gradient(circle at 20% 20%, #2d1a49, transparent 45%), - radial-gradient(circle at 80% 0%, #551e8c, transparent 40%), - radial-gradient(circle at 50% 80%, #150b28, transparent 30%); + --bg: #0b0712; + /* Panneaux, puis éléments posés dessus (champs, boutons, listes déroulantes), puis survol. */ + --surface: #140e1d; + --surface-raised: #1d1529; + --surface-hover: #281d38; + --border: rgba(255, 255, 255, 0.07); + --border-strong: rgba(255, 255, 255, 0.13); + --text: #f4effa; + --muted: #b9aecb; + --muted-dark: #8f82a6; + /* Fond des boutons principaux (avec --on-accent dessus), et accent utilisé comme texte. */ + --accent: #b47aff; + --accent-hover: #c493ff; + --on-accent: #12041f; + --accent-text: #cfa8ff; + --danger: #ff7a93; + --success: #6ee7a8; + --shadow: rgba(0, 0, 0, 0.5); + --radius: 12px; + --radius-lg: 18px; + --topbar-height: 60px; + --mini-player-height: 64px; } /* ------------------------------------------------------------------------------------------------ @@ -51,399 +51,161 @@ display: none !important; } +/* Masqué à l'écran mais lu par les lecteurs d'écran. Les !important l'emportent sur les règles + des champs (largeur 100 %, marges intérieures), qui ont une spécificité plus forte. */ .visually-hidden { - position: absolute; - width: 1px; - height: 1px; + position: absolute !important; + width: 1px !important; + height: 1px !important; + margin: -1px !important; + padding: 0 !important; + border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } -code { - background: var(--border); - border-radius: 6px; - padding: 0.1rem 0.35rem; +html { + scroll-padding-top: calc(var(--topbar-height) + 1rem); } body { margin: 0; min-height: 100vh; font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; - background: var(--gradient), var(--bg); + line-height: 1.45; + background: + radial-gradient(ellipse 70% 45% at 50% -5%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), + var(--bg); + background-attachment: fixed; color: var(--text); /* Cases à cocher et barres de progression natives aux couleurs du site. */ accent-color: var(--accent); } -main { - max-width: 1200px; - margin: 0 auto; - padding: 0 1.5rem 4rem; +/* Place pour le mini-lecteur, fixé en bas de l'écran quand il est affiché. */ +body.has-mini-player { + padding-bottom: calc(var(--mini-player-height) + 1rem); } h1, h2, -h3, -h4 { +h3 { margin: 0; + line-height: 1.2; } p { margin-top: 0; } -.text--muted { - color: var(--muted); - text-align: center; +code { + background: var(--surface-hover); + border-radius: 6px; + padding: 0.1rem 0.35rem; } -/* ------------------------------------------------------------------------------------------------ - * En-tête des pages (illustration, titre, connexion) - */ - -.hero { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - align-items: center; - gap: 2rem; - padding: 3rem 1.5rem; - max-width: 1200px; - margin: 0 auto; +/* Icônes SVG insérées par jukebox.js (fonction icon). */ +.icon { + width: 1.2em; + height: 1.2em; + flex-shrink: 0; + fill: none; + stroke: currentColor; + stroke-width: 2; + stroke-linecap: round; + stroke-linejoin: round; } -/* Page d'accueil : illustration plus grande. */ -.hero--home { - gap: 2.75rem; - - & .hero__visual img { - max-width: 320px; - } +.icon--fill { + fill: currentColor; + stroke: none; } -.hero__content { - flex: 1; - min-width: 280px; - - & h1 { - font-size: 2.2rem; - line-height: 1.1; - margin-top: 1rem; - margin-bottom: 1rem; - } - - & p { - color: var(--muted); - font-size: 1.05rem; - max-width: 500px; - } -} - -.hero__actions { - display: flex; - gap: 1rem; - margin-top: 1.5rem; -} - -.hero__actions--centered { - justify-content: center; - margin: 2rem auto 3rem; -} - -.hero__visual { - min-width: 200px; - display: flex; - justify-content: center; - - & img { - max-width: 200px; - width: 100%; - height: auto; - filter: drop-shadow(0 25px 45px rgba(0, 0, 0, 0.45)); - } -} - -.hero__auth { - max-width: 330px; -} - -.pill { - display: inline-flex; - align-items: center; - gap: 0.45rem; - font-size: 0.9rem; - padding: 0.35rem 0.85rem; - border-radius: 999px; - background: var(--border); - color: var(--muted); - letter-spacing: 0.05em; - text-transform: uppercase; -} - -/* ------------------------------------------------------------------------------------------------ - * Panneaux - */ - -.panel { - border-radius: 18px; - padding: 1.75rem; - margin-bottom: 1.75rem; - border: 1px solid var(--border); -} - -.panel--glass { - background: var(--bg-glass); - box-shadow: 0 20px 38px var(--shadow); - backdrop-filter: blur(18px); -} - -/* Fichiers glissés au-dessus de la section d'ajout. */ -.panel--dragover { - border-color: var(--accent); - border-style: dashed; -} - -.panel__subtitle { - color: var(--muted); - margin-top: 0.35rem; - margin-bottom: 1.5rem; -} - -.panel__header { - display: flex; - justify-content: space-between; - align-items: flex-start; - gap: 1rem; - margin-bottom: 1.25rem; -} - -.badge { - padding: 0.35rem 0.9rem; - background: color-mix(in srgb, var(--accent) 20%, transparent); - color: var(--accent); - border-radius: 12px; +.hint { + color: var(--muted-dark); font-size: 0.85rem; + margin: 0.4rem 0 0; +} + +.empty { + color: var(--muted-dark); + text-align: center; + margin: 1rem 0 0.5rem; +} + +.eyebrow { + color: var(--accent-text); + font-size: 0.8rem; + font-weight: 600; + letter-spacing: 0.08em; + text-transform: uppercase; + margin-bottom: 0.75rem; +} + +/* ------------------------------------------------------------------------------------------------ + * Barre du haut + */ + +.topbar { + position: sticky; + top: 0; + z-index: 20; + height: var(--topbar-height); + background: color-mix(in srgb, var(--bg) 80%, transparent); + backdrop-filter: blur(12px); + border-bottom: 1px solid var(--border); +} + +.topbar__inner { + display: flex; + align-items: center; + gap: 1rem; + max-width: 1280px; + height: 100%; + margin: 0 auto; + padding: 0 1.25rem; +} + +.brand { + display: flex; + align-items: center; + gap: 0.6rem; + color: var(--text); + font-weight: 700; + font-size: 1.05rem; + text-decoration: none; white-space: nowrap; } -/* ------------------------------------------------------------------------------------------------ - * Formulaires - */ - -label { - display: block; - font-size: 0.95rem; - color: var(--muted); - margin-bottom: 0.35rem; -} - -input[type="text"], -input[type="password"], -input[type="url"], -input[type="search"], -input[type="file"], -select, -textarea { - width: 100%; - padding: 0.7rem 0.9rem; - border-radius: 12px; - border: 1px solid var(--border-strong); - background: var(--surface-soft); - color: #fff; - font-size: 1rem; -} - -select { - background-color: var(--bg-raised); - cursor: pointer; -} - -select option, -select optgroup { - background-color: var(--bg-raised); - color: var(--text); -} - -input[type="file"] { - padding: 0.5rem; - color: var(--muted); - cursor: pointer; - - &::file-selector-button { - margin-right: 0.75rem; - padding: 0.4rem 1rem; - border: none; - border-radius: 999px; - background: var(--surface-strong); - color: var(--text); - font: inherit; - font-size: 0.9rem; - font-weight: 600; - cursor: pointer; - } - - &:hover::file-selector-button { - background: color-mix(in srgb, var(--accent) 35%, transparent); - } -} - -input:focus, -textarea:focus, -select:focus { - outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); - border-color: color-mix(in srgb, var(--accent) 60%, transparent); -} - -.form-checkbox { +.topbar__account { display: flex; - align-items: flex-start; - gap: 0.5rem; - color: var(--muted); -} - -.form-checkbox__input { - margin-top: 0.25rem; -} - -/* Section repliable du mot de passe, quand la connexion avec Discord est proposée. */ -.key-login summary { - cursor: pointer; - color: var(--muted); - margin: 1rem 0 0.75rem; -} - -.form-actions { - margin-top: 1.25rem; - display: flex; - justify-content: flex-end; -} - -/* ------------------------------------------------------------------------------------------------ - * Boutons - */ - -.btn { - border: none; - border-radius: 999px; - padding: 0.65rem 1.55rem; - font-weight: 600; - cursor: pointer; - background: var(--accent-gradient); - color: var(--on-accent); - transition: transform 0.15s ease, box-shadow 0.15s ease; - - &:hover { - transform: translateY(-1px); - box-shadow: 0 10px 25px color-mix(in srgb, var(--accent) 35%, transparent); - } - - &:disabled { - opacity: 0.55; - cursor: not-allowed; - box-shadow: none; - transform: none; - } -} - -.btn--secondary { - background: var(--surface-strong); - color: #fff; -} - -.btn--danger { - background: linear-gradient(120deg, var(--danger), #ff89a5); - color: #fff; -} - -.btn--ghost { - background: transparent; - border: 1px solid rgba(255, 255, 255, 0.35); - color: #fff; -} - -.btn--small { - padding: 0.4rem 1rem; - font-size: 0.9rem; -} - -a.btn { - display: inline-block; - text-decoration: none; - text-align: center; -} - -/* Bouton aux couleurs de Discord (blurple), avec son logo. */ -.btn.btn--discord { - display: inline-flex; align-items: center; - justify-content: center; - gap: 0.55rem; - width: 100%; - min-height: 46px; - padding: 0.6rem 0.9rem; - font-size: 0.95rem; - line-height: 1.2; - border: 1px solid #6f7bff; - border-radius: 10px; - background: #5865f2; - box-shadow: 0 6px 16px rgba(35, 39, 96, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14); - color: #fff; - font-weight: 700; - - & svg { - flex: 0 0 24px; - width: 24px; - height: 24px; - } - - &:hover { - border-color: #7c86ff; - background: #4752c4; - box-shadow: 0 8px 20px rgba(35, 39, 96, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.16); - } -} - -/* Bouton à bascule activé (boucle) : reprend l'aspect du bouton principal. */ -.btn[aria-pressed="true"] { - background: var(--accent-gradient); - color: var(--on-accent); -} - -.btn:focus-visible { - outline: 2px solid #fff; - outline-offset: 2px; -} - -.toolbar { - display: flex; - flex-wrap: wrap; - gap: 0.5rem; -} - -.control-group { - display: flex; - flex-wrap: wrap; gap: 0.75rem; - margin-top: 1.25rem; + margin-left: auto; + min-width: 0; } -/* ------------------------------------------------------------------------------------------------ - * Lecteur : indicateur du flux en direct, morceau en cours, progression - */ +.topbar__user { + color: var(--muted); + font-size: 0.9rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .live-indicator { display: inline-flex; align-items: center; gap: 0.45rem; - font-size: 0.85rem; + font-size: 0.8rem; color: var(--muted-dark); white-space: nowrap; &::before { content: ""; - width: 0.55rem; - height: 0.55rem; + width: 0.5rem; + height: 0.5rem; border-radius: 50%; background: var(--muted-dark); } @@ -458,52 +220,644 @@ a.btn { } } -.player-current { - background: rgba(0, 0, 0, 0.25); - border-radius: 16px; - padding: 1.2rem; - border: 1px solid var(--border); +/* ------------------------------------------------------------------------------------------------ + * Écran de connexion + */ + +.welcome { + display: flex; + align-items: center; + justify-content: center; + gap: 3rem; + max-width: 1000px; + min-height: calc(100vh - var(--topbar-height)); + margin: 0 auto; + padding: 2rem 1.5rem; } -.player-current--empty { +.welcome__visual { + width: 100%; + max-width: 300px; + height: auto; + filter: drop-shadow(0 25px 45px var(--shadow)); +} + +.welcome__content { + flex: 1; + max-width: 460px; + + & h1 { + font-size: 2.3rem; + margin-bottom: 1rem; + } + + & .btn--discord { + margin-top: 0.5rem; + } +} + +.welcome__text { color: var(--muted); + font-size: 1.05rem; + margin-bottom: 1.5rem; +} + +/* Mot de passe : replié sous le bouton Discord, ou seul moyen de se connecter. */ +.key-login { + margin-top: 1.25rem; + + & summary { + cursor: pointer; + color: var(--muted); + } +} + +.key-login__form { + margin-top: 1rem; + padding: 1.25rem; + border: 1px solid var(--border); + border-radius: var(--radius-lg); + background: var(--surface); +} + +/* ------------------------------------------------------------------------------------------------ + * Mise en page de l'application + */ + +.layout { + display: grid; + gap: 1.25rem; + max-width: 1280px; + margin: 0 auto; + padding: 1.25rem 1.25rem 3rem; +} + +.layout__side, +.layout__main { + display: flex; + flex-direction: column; + gap: 1.25rem; + min-width: 0; +} + +/* Deux colonnes : bibliothèque à gauche ; lecteur et file à droite, fixés pendant le défilement, + la file défilant dans son panneau. */ +@media (min-width: 1000px) { + .layout { + grid-template-columns: minmax(0, 1fr) 380px; + align-items: start; + } + + .layout__main { + grid-column: 1; + grid-row: 1; + } + + .layout__side { + grid-column: 2; + grid-row: 1; + position: sticky; + top: calc(var(--topbar-height) + 1.25rem); + max-height: calc(100vh - var(--topbar-height) - 2.5rem); + } + + .queue { + min-height: 0; + overflow-y: auto; + } +} + +/* ------------------------------------------------------------------------------------------------ + * Panneaux + */ + +.panel { + border-radius: var(--radius-lg); + padding: 1.25rem 1.5rem; + border: 1px solid var(--border); + background: var(--surface); + box-shadow: 0 12px 30px var(--shadow); +} + +/* Fichiers glissés au-dessus de la section d'ajout. */ +.panel--dragover { + border-color: var(--accent); + border-style: dashed; +} + +.panel__header { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 1rem; + margin-bottom: 1rem; +} + +.panel__title { + font-size: 1.15rem; +} + +.panel__subtitle { + color: var(--muted); + font-size: 0.92rem; + margin: 0.25rem 0 0; +} + +#uploadSection .panel__subtitle { + margin-bottom: 1rem; +} + +.badge { + padding: 0.25rem 0.7rem; + background: color-mix(in srgb, var(--accent) 16%, transparent); + color: var(--accent-text); + border-radius: 999px; + font-size: 0.8rem; + white-space: nowrap; +} + +/* ------------------------------------------------------------------------------------------------ + * Formulaires + */ + +label { + display: block; + font-size: 0.9rem; + color: var(--muted); + margin-bottom: 0.35rem; +} + +input[type="text"], +input[type="password"], +input[type="url"], +input[type="search"], +input[type="file"], +select, +textarea { + width: 100%; + padding: 0.65rem 0.9rem; + border-radius: var(--radius); + border: 1px solid var(--border-strong); + background: var(--surface-raised); + color: var(--text); + font: inherit; + font-size: 0.95rem; +} + +::placeholder { + color: var(--muted-dark); +} + +/* Fond plein, options comprises : le navigateur dessine sinon la liste ouverte sur du blanc. */ +select { + cursor: pointer; +} + +select option, +select optgroup { + background-color: var(--surface-raised); + color: var(--text); +} + +input[type="file"] { + padding: 0.45rem; + color: var(--muted); + cursor: pointer; + + &::file-selector-button { + margin-right: 0.75rem; + padding: 0.35rem 0.9rem; + border: 1px solid var(--border-strong); + border-radius: 999px; + background: var(--surface-hover); + color: var(--text); + font: inherit; + font-size: 0.85rem; + font-weight: 600; + cursor: pointer; + } + + &:hover::file-selector-button { + border-color: var(--accent); + } +} + +input:focus-visible, +textarea:focus-visible, +select:focus-visible { + outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); + outline-offset: 1px; + border-color: transparent; +} + +.form-checkbox { + display: flex; + align-items: flex-start; + gap: 0.5rem; + color: var(--muted); + cursor: pointer; +} + +.form-checkbox__input { + margin-top: 0.2rem; +} + +.form-actions { + margin-top: 1rem; + display: flex; + justify-content: flex-end; +} + +/* Zone de dépôt : le vrai champ de fichiers est masqué, la zone en est l'étiquette. */ +.dropzone { + display: flex; + align-items: center; + justify-content: center; + gap: 0.75rem; + min-height: 96px; + margin: 0; + padding: 1rem; + border: 1.5px dashed var(--border-strong); + border-radius: var(--radius-lg); + background: var(--surface-raised); + color: var(--muted); + text-align: center; + cursor: pointer; + transition: border-color 0.15s ease, background 0.15s ease; + + &:hover, + .panel--dragover & { + border-color: var(--accent); + background: var(--surface-hover); + } + + & strong { + color: var(--accent-text); + } + + input:focus-visible + & { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.dropzone__icon { + display: inline-flex; + font-size: 1.4rem; + color: var(--accent-text); +} + +.dropzone__text { + overflow-wrap: anywhere; +} + +/* ------------------------------------------------------------------------------------------------ + * Boutons + */ + +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.4rem; + border: 1px solid var(--border-strong); + border-radius: 999px; + padding: 0.55rem 1.2rem; + font: inherit; + font-size: 0.92rem; + font-weight: 600; + line-height: 1.2; + cursor: pointer; + background: var(--surface-raised); + color: var(--text); + text-decoration: none; + white-space: nowrap; + transition: background 0.15s ease, border-color 0.15s ease; + + &:hover { + background: var(--surface-hover); + } + + &:disabled { + opacity: 0.45; + cursor: not-allowed; + } + + &:focus-visible { + outline: 2px solid var(--accent-text); + outline-offset: 2px; + } +} + +.btn--primary { + background: var(--accent); + border-color: transparent; + color: var(--on-accent); + + &:hover { + background: var(--accent-hover); + } +} + +.btn--ghost { + background: transparent; +} + +.btn--danger { + background: color-mix(in srgb, var(--danger) 12%, transparent); + border-color: color-mix(in srgb, var(--danger) 35%, transparent); + color: var(--danger); + + &:hover { + background: color-mix(in srgb, var(--danger) 22%, transparent); + } +} + +.btn--small { + padding: 0.35rem 0.85rem; + font-size: 0.85rem; +} + +/* Bouton aux couleurs de Discord (blurple), avec son logo. */ +.btn.btn--discord { + gap: 0.55rem; + width: 100%; + min-height: 48px; + border: 1px solid #6f7bff; + border-radius: var(--radius); + background: #5865f2; + box-shadow: 0 6px 16px rgba(35, 39, 96, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14); + color: #fff; + font-weight: 700; + + & svg { + flex: 0 0 24px; + width: 24px; + height: 24px; + } + + &:hover { + border-color: #7c86ff; + background: #4752c4; + } +} + +/* Bouton rond à icône seule ; son nom passe par aria-label. */ +.icon-btn { + display: inline-grid; + place-items: center; + flex-shrink: 0; + width: 36px; + height: 36px; + padding: 0; + border: none; + border-radius: 50%; + background: transparent; + color: var(--muted); + font-size: 1rem; + cursor: pointer; + transition: background 0.15s ease, color 0.15s ease; + + &:hover { + background: var(--surface-hover); + color: var(--text); + } + + &:disabled { + opacity: 0.3; + cursor: not-allowed; + background: transparent; + } + + &:focus-visible { + outline: 2px solid var(--accent-text); + outline-offset: 2px; + } + + /* Bouton à bascule activé (boucle). */ + &[aria-pressed="true"] { + background: color-mix(in srgb, var(--accent) 18%, transparent); + color: var(--accent-text); + } +} + +.icon-btn--primary { + background: var(--accent); + color: var(--on-accent); + + &:hover { + background: var(--accent-hover); + color: var(--on-accent); + } +} + +.icon-btn--large { + width: 56px; + height: 56px; + font-size: 1.35rem; +} + +.icon-btn--danger:hover { + background: color-mix(in srgb, var(--danger) 15%, transparent); + color: var(--danger); +} + +.toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; +} + +/* ------------------------------------------------------------------------------------------------ + * Lecteur : morceau en cours, position, commandes + */ + +.player__track { + display: flex; + align-items: center; + gap: 1rem; + margin: 1rem 0 0.75rem; + min-height: 96px; +} + +.player__track--empty { + justify-content: center; + color: var(--muted-dark); text-align: center; } -.player-current:not(.player-current--empty) { +.player__title { + font-weight: 700; + font-size: 1.05rem; + overflow-wrap: anywhere; +} + +.player__controls { display: flex; align-items: center; - gap: 1.1rem; + justify-content: center; + gap: 1rem; + margin-top: 0.5rem; } -.progress { - margin-top: 0.9rem; +.player__stop { + display: flex; + margin: 1rem auto 0; } -.progress__track { - height: 6px; - border-radius: 999px; - background: rgba(255, 255, 255, 0.1); - overflow: hidden; +/* Barre de position : un curseur natif, dont la partie jouée est peinte d'après --progress. */ +.seek__input { + --progress: 0%; + appearance: none; + -webkit-appearance: none; + display: block; + width: 100%; + height: 18px; + margin: 0; + background: transparent; + cursor: pointer; + + &::-webkit-slider-runnable-track { + height: 6px; + border-radius: 999px; + background: linear-gradient( + to right, + var(--accent) var(--progress), + var(--surface-hover) var(--progress) + ); + } + + &::-webkit-slider-thumb { + -webkit-appearance: none; + width: 14px; + height: 14px; + margin-top: -4px; + border-radius: 50%; + background: var(--text); + opacity: 0; + transition: opacity 0.15s ease; + } + + &::-moz-range-track { + height: 6px; + border-radius: 999px; + background: var(--surface-hover); + } + + &::-moz-range-progress { + height: 6px; + border-radius: 999px; + background: var(--accent); + } + + &::-moz-range-thumb { + width: 14px; + height: 14px; + border: none; + border-radius: 50%; + background: var(--text); + opacity: 0; + transition: opacity 0.15s ease; + } + + &:hover::-webkit-slider-thumb, + &:focus-visible::-webkit-slider-thumb, + &:active::-webkit-slider-thumb, + &:hover::-moz-range-thumb, + &:focus-visible::-moz-range-thumb, + &:active::-moz-range-thumb { + opacity: 1; + } + + &:focus-visible { + outline: 2px solid var(--accent-text); + outline-offset: 4px; + border-radius: 4px; + } } -.progress__bar { - height: 100%; - width: 0; - background: var(--accent-gradient); - /* La largeur est mise à jour chaque seconde : la transition rend l'avancée continue. */ - transition: width 0.9s linear; -} - -.progress__times { +.seek__times { display: flex; justify-content: space-between; - color: var(--muted); - font-size: 0.85rem; - margin-top: 0.35rem; + color: var(--muted-dark); + font-size: 0.8rem; + margin-top: 0.2rem; font-variant-numeric: tabular-nums; } +/* Mini-lecteur des petits écrans, en bas de l'écran. Jamais affiché sur deux colonnes. */ +.mini-player { + position: fixed; + left: 0.75rem; + right: 0.75rem; + bottom: 0.75rem; + z-index: 15; + display: flex; + align-items: center; + gap: 0.5rem; + height: var(--mini-player-height); + padding: 0 0.6rem; + overflow: hidden; + border: 1px solid var(--border-strong); + border-radius: var(--radius-lg); + background: color-mix(in srgb, var(--surface-raised) 92%, transparent); + backdrop-filter: blur(12px); + box-shadow: 0 12px 30px var(--shadow); + + @media (min-width: 1000px) { + display: none !important; + } + + & .icon-btn--primary { + width: 42px; + height: 42px; + } +} + +.mini-player__info { + display: flex; + align-items: center; + gap: 0.65rem; + flex: 1; + min-width: 0; + padding: 0; + border: none; + background: none; + color: var(--text); + font: inherit; + text-align: left; + cursor: pointer; + + & .cover { + width: 44px; + height: 44px; + border-radius: 10px; + } +} + +.mini-player__title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: 600; + font-size: 0.92rem; +} + +.mini-player__progress { + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 3px; + + & > div { + height: 100%; + width: 0; + background: var(--accent); + transition: width 0.9s linear; + } +} + /* ------------------------------------------------------------------------------------------------ * Ajout de morceaux : envois en cours, ajout par lien */ @@ -522,7 +876,6 @@ a.btn { & progress { width: 100%; - accent-color: var(--accent); } &[data-state="ok"] .upload-list__state { @@ -555,37 +908,39 @@ a.btn { gap: 0.75rem; } -.hint { - color: var(--muted-dark); - font-size: 0.85rem; - margin: 0.5rem 0 0; -} - /* ------------------------------------------------------------------------------------------------ - * Messages d'état (voir createStatusManager dans common.js) + * Messages d'état (voir createStatusManager dans common.js) : bulle en bas de l'écran */ -.status { - padding: 0.85rem 1.25rem; - border-radius: 999px; - font-size: 0.95rem; - margin: 1rem 0 2rem; - max-width: 600px; -} +.toast { + position: fixed; + left: 50%; + bottom: 1.25rem; + z-index: 30; + transform: translateX(-50%); + width: max-content; + max-width: min(560px, calc(100% - 1.5rem)); + padding: 0.75rem 1.15rem; + border: 1px solid var(--border-strong); + border-radius: var(--radius); + background: var(--surface-raised); + box-shadow: 0 12px 30px var(--shadow); + font-size: 0.92rem; + color: var(--accent-text); -.status--info { - background: color-mix(in srgb, var(--accent) 20%, transparent); - color: var(--accent); -} + &[data-type="error"] { + color: var(--danger); + border-color: color-mix(in srgb, var(--danger) 45%, transparent); + } -.status--error { - background: color-mix(in srgb, var(--danger) 15%, transparent); - color: var(--danger); -} + &[data-type="success"] { + color: var(--success); + border-color: color-mix(in srgb, var(--success) 40%, transparent); + } -.status--success { - background: color-mix(in srgb, var(--success) 15%, transparent); - color: var(--success); + .has-mini-player & { + bottom: calc(var(--mini-player-height) + 1.5rem); + } } /* ------------------------------------------------------------------------------------------------ @@ -598,54 +953,83 @@ a.btn { margin: 0; } -.list--stack > li { - border-bottom: 1px solid var(--border); +.list--stack > li + li { + border-top: 1px solid var(--border); } .media-item { display: flex; - gap: 1rem; - justify-content: space-between; + gap: 0.85rem; align-items: center; - padding: 0.9rem 0; + padding: 0.7rem 0; } .media-item__info { flex: 1; + min-width: 0; } .media-item__title { font-weight: 600; - font-size: 1rem; + font-size: 0.95rem; + overflow-wrap: anywhere; } .media-item__meta { - color: var(--muted); - font-size: 0.9rem; + color: var(--muted-dark); + font-size: 0.82rem; } .media-item__actions { display: flex; - flex-wrap: wrap; - gap: 0.4rem; + align-items: center; + gap: 0.15rem; +} + +.media-item__actions .btn { + margin-right: 0.35rem; +} + +/* File d'attente : lignes plus serrées, numéro devant le titre. */ +.media-item--queue { + gap: 0.7rem; + padding: 0.55rem 0; + + & .cover { + width: 44px; + height: 44px; + border-radius: 10px; + } + + & .icon-btn { + width: 30px; + height: 30px; + font-size: 0.9rem; + } +} + +.media-item__position { + color: var(--muted-dark); + font-variant-numeric: tabular-nums; + margin-right: 0.25rem; } /* Pochette d'un morceau : , ou
            vide (note de musique) ou à image de fond (aperçu). */ .cover { flex-shrink: 0; - width: 72px; - height: 72px; - border-radius: 12px; + width: 56px; + height: 56px; + border-radius: var(--radius); object-fit: cover; - background: var(--surface-soft) center / cover no-repeat; + background: var(--surface-raised) center / cover no-repeat; border: 1px solid var(--border); } /* Lecteur et fenêtre de modification. */ .cover--large { - width: 160px; - height: 160px; - border-radius: 18px; + width: 96px; + height: 96px; + border-radius: 16px; } .cover--empty { @@ -655,38 +1039,46 @@ a.btn { &::after { content: "♪"; - font-size: 1.8rem; + font-size: 1.4rem; } &.cover--large::after { - font-size: 3.5rem; + font-size: 2.6rem; } } /* ------------------------------------------------------------------------------------------------ - * Bibliothèque : sections repliables et fenêtre de modification (morceau ou section) + * Bibliothèque : outils, sections repliables, étiquettes, fenêtre de modification */ +.library-tools { + display: flex; + flex-wrap: wrap; + gap: 0.75rem; + align-items: center; + + & input[type="search"] { + flex: 1 1 300px; + width: auto; + } +} + .library { margin-top: 1rem; } .library-section { border: 1px solid var(--border); - border-radius: 14px; + border-radius: 16px; padding: 0 1rem; margin-bottom: 0.75rem; - background: var(--surface-soft); - - & .list--stack > li:last-child { - border-bottom: none; - } + background: color-mix(in srgb, var(--surface-raised) 55%, transparent); } .library-section__summary { display: flex; align-items: center; - gap: 0.75rem; + gap: 0.85rem; padding: 0.85rem 0; cursor: pointer; list-style: none; @@ -697,7 +1089,7 @@ a.btn { &::before { content: "▸"; - color: var(--accent); + color: var(--accent-text); transition: transform 0.15s ease; } @@ -711,10 +1103,47 @@ a.btn { display: flex; flex-wrap: wrap; align-items: baseline; - gap: 0.25rem 0.75rem; + gap: 0.15rem 0.75rem; min-width: 0; } +/* Image de la section, entre la flèche et le nom. */ +.cover--section { + width: 80px; + height: 80px; + border-radius: 14px; +} + +.library-section__name { + font-weight: 700; + font-size: 1.05rem; +} + +.library-section__count { + color: var(--muted-dark); + font-size: 0.85rem; +} + +/* Ajout en bloc à gauche, gestion de la section (icônes) à droite. */ +.library-section__toolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.4rem; + padding-bottom: 0.6rem; + border-bottom: 1px solid var(--border); +} + +.library-section__manage { + display: flex; + gap: 0.1rem; + margin-left: auto; +} + +.library-section__empty { + padding: 0.75rem 0 1rem; +} + /* Étiquettes : sous un morceau, en barre de filtre au-dessus de la bibliothèque, ou en suggestions dans la fenêtre de modification. Celle du filtre actif est pressée. */ .tag-list { @@ -723,7 +1152,7 @@ a.btn { gap: 0.35rem; &:not(:empty) { - margin-top: 0.4rem; + margin-top: 0.35rem; } } @@ -735,68 +1164,42 @@ a.btn { display: inline-flex; align-items: center; gap: 0.35rem; - padding: 0.2rem 0.7rem; - border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); + padding: 0.15rem 0.65rem; + border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; - background: color-mix(in srgb, var(--accent) 15%, transparent); + background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); font: inherit; - font-size: 0.8rem; + font-size: 0.78rem; cursor: pointer; &:hover { - background: color-mix(in srgb, var(--accent) 30%, transparent); + background: color-mix(in srgb, var(--accent) 22%, transparent); } &[aria-pressed="true"] { - background: var(--accent-gradient); + background: var(--accent); color: var(--on-accent); border-color: transparent; } &:focus-visible { - outline: 2px solid #fff; + outline: 2px solid var(--accent-text); outline-offset: 2px; } } .tag__count { opacity: 0.7; - font-size: 0.75rem; -} - -/* Image de la section, entre la flèche et le nom. */ -.cover--section { - width: 96px; - height: 96px; - border-radius: 14px; -} - -.library-section__name { - font-weight: 600; - font-size: 1.05rem; -} - -.library-section__count { - color: var(--muted); - font-size: 0.9rem; -} - -.library-section__toolbar { - padding-bottom: 0.5rem; - border-bottom: 1px solid var(--border); -} - -.library-section__empty { - padding: 0.75rem 0 1rem; + font-size: 0.72rem; } .dialog { width: min(520px, calc(100% - 2rem)); - padding: 1.75rem; - border-radius: 18px; + padding: 1.5rem; + border-radius: var(--radius-lg); border: 1px solid var(--border-strong); - background: var(--bg-card); + background: var(--surface); color: var(--text); box-shadow: 0 20px 38px var(--shadow); @@ -806,6 +1209,7 @@ a.btn { } & h2 { + font-size: 1.25rem; margin-bottom: 1.25rem; } } @@ -822,32 +1226,108 @@ a.btn { } /* ------------------------------------------------------------------------------------------------ - * Page d'accueil : cartes vers les pages du site + * Petits écrans */ -.feature-grid { - display: grid; - gap: 1rem; - grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); -} - -.feature-grid__card { - text-decoration: none; - color: inherit; - display: block; - border: 1px solid var(--border); - border-radius: 18px; - padding: 1.25rem 1.5rem; - background: var(--bg-card); - transition: transform 0.15s ease, box-shadow 0.15s ease; - - &:hover { - transform: translateY(-3px); - box-shadow: 0 15px 30px var(--shadow); +@media (max-width: 760px) { + .welcome { + flex-direction: column; + gap: 1.5rem; + min-height: 0; + text-align: center; } - & .pill { - margin-bottom: 0.5rem; + .welcome__visual { + max-width: 170px; + } + + .welcome__content h1 { + font-size: 1.8rem; + } + + .key-login__form { + text-align: left; + } +} + +@media (max-width: 600px) { + .topbar__inner { + padding: 0 0.9rem; + gap: 0.6rem; + } + + .brand span, + .topbar__user { + display: none; + } + + .layout { + padding: 0.9rem 0.75rem 2rem; + gap: 0.9rem; + } + + .layout__side, + .layout__main { + gap: 0.9rem; + } + + .panel { + padding: 1rem; + } + + .panel__header { + flex-direction: column; + } + + /* File d'attente : le compteur reste à côté du titre. */ + .queue .panel__header { + flex-direction: row; + align-items: center; + } + + .url-form__row { + flex-direction: column; + } + + .upload-list__item { + grid-template-columns: 1fr; + gap: 0.25rem; + } + + .library-section { + padding: 0 0.75rem; + } + + .cover--section { + width: 64px; + height: 64px; + } + + .media-item { + gap: 0.7rem; + } + + /* Bibliothèque : titre sur toute la largeur, boutons en dessous. */ + .media-item--library { + flex-wrap: wrap; + + & .cover { + width: 48px; + height: 48px; + } + + & .media-item__info { + flex: 1 1 0; + } + + & .media-item__actions { + flex-basis: 100%; + justify-content: flex-end; + } + } + + .cover-editor { + flex-direction: column; } } @@ -857,120 +1337,13 @@ a.btn { .grid { display: grid; - gap: 1rem; + gap: 0.75rem 1rem; } .grid--two { - grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } .u-mt-1 { margin-top: 1rem; } - -/* ------------------------------------------------------------------------------------------------ - * Petits écrans - */ - -@media (max-width: 900px) { - .hero { - flex-direction: column; - text-align: center; - } - - .hero__content p { - margin: 0 auto; - } - - .hero__actions { - justify-content: center; - } - - .panel__header { - flex-direction: column; - align-items: flex-start; - } -} - -@media (max-width: 600px) { - .btn { - width: 100%; - } - - /* L'illustration ne doit pas occuper tout le premier écran. */ - .hero .hero__visual img { - max-width: 150px; - } - - .hero { - padding: 1.5rem 1rem; - gap: 1rem; - } - - .url-form__row { - flex-direction: column; - } - - /* Boutons du lecteur sur deux colonnes ; « Stop & vider la file » seul en bas, à l'écart. */ - .control-group { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 0.5rem; - - & .btn--danger { - grid-column: 1 / -1; - } - } - - .upload-list__item { - grid-template-columns: 1fr; - gap: 0.25rem; - } - - /* Pochette et titre côte à côte, boutons en dessous sur toute la largeur. */ - .media-item { - flex-wrap: wrap; - } - - .media-item__info { - flex: 1 1 0; - min-width: 0; - } - - .media-item__actions { - flex-basis: 100%; - } - - .cover-editor { - flex-direction: column; - } - - .cover { - width: 60px; - height: 60px; - } - - .cover--large, - .cover--section { - width: 96px; - height: 96px; - } - - /* Boutons resserrés : « Ajouter, Modifier, Supprimer » tiennent sur une ligne. */ - .media-item__actions .btn, - .library-section__toolbar .btn { - width: auto; - flex: 1; - padding-inline: 0.5rem; - white-space: nowrap; - } - - /* Flèches de déplacement à leur taille, sans s'étirer sur la ligne. */ - .library-section__toolbar .btn:is([data-action="up"], [data-action="down"]) { - flex: 0 0 2.75rem; - } - - .panel { - padding: 1.25rem; - } -} diff --git a/src/music/queue.js b/src/music/queue.js index 7083ac9..3b57729 100644 --- a/src/music/queue.js +++ b/src/music/queue.js @@ -4,7 +4,7 @@ * * Contexte : une seule instance, créée par index.js et partagée par les commandes Discord * (client.musicQueue) et le serveur web. - * Points d'entrée : enqueue, remove, move, skip, stop, start, snapshot ; événements « queueUpdate » + * Points d'entrée : enqueue, remove, move, skip, seek, stop, start, snapshot ; événements « queueUpdate » * (état de la file, émis ici) et « libraryUpdate » (bibliothèque modifiée, émis par les routes). * Utilisé par : index.js, /play, /queue, /skip, web/routes/ et music/ingest.js. * Dépend de : @discordjs/voice, media/validateAudioFile.js (flux Opus), @@ -431,6 +431,24 @@ class MusicQueue extends EventEmitter { this.emit("queueUpdate", this.snapshot()); } + // Déplace la lecture du morceau en cours à `seconds`, bornée à sa durée connue. Un nouveau flux + // ffmpeg, qui démarre à cette position (resumeAt), remplace l'ancien : le lecteur ne passe pas + // par Idle, le morceau n'est donc ni terminé ni remis en boucle. En pause, la lecture repart. + // Renvoie null sans morceau en cours. + seek(seconds) { + if (!this.currentTrack) return null; + let position = Math.max(0, Math.floor(Number(seconds) || 0)); + const duration = Number(this.currentTrack.duration); + if (duration > 0) { + position = Math.min(position, Math.max(0, Math.floor(duration) - 1)); + } + const { resumeAt: _resumeAt, ...track } = this.currentTrack; + this.currentTrack = position > 0 ? { ...track, resumeAt: position } : track; + this.audioPlayer.play(this.createResource(this.currentTrack)); + this.emit("queueUpdate", this.snapshot()); + return this.snapshot(); + } + pause() { this.audioPlayer.pause(true); } diff --git a/src/web/routes/auth.js b/src/web/routes/auth.js index 464d061..fae3e58 100644 --- a/src/web/routes/auth.js +++ b/src/web/routes/auth.js @@ -41,7 +41,7 @@ function authRouter({ oauth, findMember, fetchImpl = fetch }) { const router = Router(); const secure = oauth.enabled && new URL(oauth.publicUrl).protocol === "https:"; const redirectUri = oauth.enabled ? `${oauth.publicUrl}/auth/discord/callback` : null; - const fail = (res, reason) => res.redirect(303, `/jukebox/?login=${reason}`); + const fail = (res, reason) => res.redirect(303, `/?login=${reason}`); router.get("/me", (req, res) => { res.set("Cache-Control", "no-store"); @@ -117,7 +117,7 @@ function authRouter({ oauth, findMember, fetchImpl = fetch }) { ) ); console.log(`[${new Date().toLocaleString()}] Web login: ${user.id}`); - return res.redirect(303, "/jukebox/"); + return res.redirect(303, "/"); } catch (error) { console.error("Discord login failed", error); return fail(res, "failed"); diff --git a/src/web/routes/player.js b/src/web/routes/player.js index 867ac6e..1dce6fc 100644 --- a/src/web/routes/player.js +++ b/src/web/routes/player.js @@ -1,6 +1,6 @@ /** * @file Routes /api/player : boutons du lecteur (lecture, pause, reprise, suivant, arrêt, mélange, - * boucle) ; chacune renvoie le nouvel état de la file. + * boucle) et déplacement dans le morceau en cours ; chacune renvoie le nouvel état de la file. */ import { Router } from "express"; @@ -28,6 +28,19 @@ function playerRouter({ queue }) { res.json(queue.snapshot()); }); + // Corps : position, en secondes depuis le début du morceau en cours. + router.post("/seek", (req, res) => { + const position = req.body?.position; + if (typeof position !== "number" || !Number.isFinite(position) || position < 0) { + return res.status(400).json({ error: "position doit être un nombre de secondes positif" }); + } + const snapshot = queue.seek(position); + if (!snapshot) { + return res.status(409).json({ error: "Aucun morceau en cours" }); + } + res.json(snapshot); + }); + router.post("/stop", (req, res) => { queue.stop(); res.json(queue.snapshot()); diff --git a/src/web/server.js b/src/web/server.js index 4a3c022..662ebd5 100644 --- a/src/web/server.js +++ b/src/web/server.js @@ -153,9 +153,11 @@ function createApp( "/covers", express.static(COVERS_DIR, { immutable: true, maxAge: "365d", index: false, redirect: false }) ); - app.get(["/jukebox", "/jukebox/"], (_req, res) => - res.sendFile(path.join(PUBLIC_DIR, "jukebox.html")) - ); + // Ancienne adresse du jukebox, devenu la page d'accueil : les favoris continuent de marcher. + app.get(["/jukebox", "/jukebox/"], (req, res) => { + const query = req.originalUrl.indexOf("?"); + res.redirect(301, query === -1 ? "/" : `/${req.originalUrl.slice(query)}`); + }); app.use(express.static(PUBLIC_DIR)); app.use((error, _req, res, _next) => { diff --git a/test/discordAuth.test.js b/test/discordAuth.test.js index e6bf54e..4924b81 100644 --- a/test/discordAuth.test.js +++ b/test/discordAuth.test.js @@ -99,7 +99,7 @@ test("a guild member logs in with Discord and uses the jukebox API", async () => await withApp(async (base) => { const callback = await login(base, "member"); assert.equal(callback.status, 303); - assert.equal(callback.headers.get("location"), "/jukebox/"); + assert.equal(callback.headers.get("location"), "/"); const session = cookieValue(callback, "palico_session"); assert.ok(session); @@ -114,7 +114,7 @@ test("a guild member logs in with Discord and uses the jukebox API", async () => test("someone outside the guild is turned away", async () => { await withApp(async (base) => { const callback = await login(base, "stranger"); - assert.equal(callback.headers.get("location"), "/jukebox/?login=not-member"); + assert.equal(callback.headers.get("location"), "/?login=not-member"); assert.equal(cookieValue(callback, "palico_session"), null); }); }); @@ -125,7 +125,7 @@ test("a callback without the matching state is refused", async () => { redirect: "manual", headers: { cookie: "palico_oauth_state=other" }, }); - assert.equal(callback.headers.get("location"), "/jukebox/?login=state"); + assert.equal(callback.headers.get("location"), "/?login=state"); assert.equal(calls.length, 0); }); }); diff --git a/test/musicQueue.test.js b/test/musicQueue.test.js index 5a9ce1a..726c9b0 100644 --- a/test/musicQueue.test.js +++ b/test/musicQueue.test.js @@ -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); diff --git a/test/webServer.test.js b/test/webServer.test.js index 57f64fd..d78d077 100644 --- a/test/webServer.test.js +++ b/test/webServer.test.js @@ -1,6 +1,7 @@ /** * @file Couvre l'application web : route des messages privés (clé, limite, connexions locales), - * /readyz et flux d'événements. + * /readyz, ancienne adresse du jukebox, déplacement dans le morceau en cours et flux + * d'événements. */ import test from "node:test"; @@ -47,6 +48,8 @@ function fakeClient() { const fakeQueue = { snapshot: () => ({ current: null, upcoming: [], status: "idle" }), + // Aucun morceau en cours, sauf quand la position demandée vaut 42. + seek: (seconds) => (seconds === 42 ? { position: 42_000 } : null), }; async function withServer(options, run) { @@ -198,6 +201,35 @@ test("the events stream sends the queue state, then every update", async () => { } }); +test("the old jukebox address redirects to the home page", async () => { + await withServer({}, async ({ base }) => { + const get = (path) => fetch(`${base}${path}`, { redirect: "manual" }); + const plain = await get("/jukebox/"); + assert.equal(plain.status, 301); + assert.equal(plain.headers.get("location"), "/"); + assert.equal((await get("/jukebox?login=denied")).headers.get("location"), "/?login=denied"); + const home = await get("/"); + assert.equal(home.status, 200); + assert.match(await home.text(), /Palico Jukebox<\/title>/); + }); +}); + +test("seeking needs a position in seconds and a track playing", async () => { + await withServer({}, async ({ base }) => { + const seek = (body) => + fetch(`${base}/api/player/seek`, { + method: "POST", + headers: { authorization: "Bearer web-key", "content-type": "application/json" }, + body: JSON.stringify(body), + }); + assert.equal((await seek({ position: 42 })).status, 200); + assert.equal((await seek({ position: 10 })).status, 409); + assert.equal((await seek({ position: "42" })).status, 400); + assert.equal((await seek({ position: -1 })).status, 400); + assert.equal((await seek({})).status, 400); + }); +}); + test("the events stream requires the jukebox key", async () => { await withServer({}, async ({ base }) => { assert.equal((await fetch(`${base}/api/events`)).status, 401);