From 4fe24af25134df0ed71c652b8819d5605814a451 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 2 May 2026 20:24:41 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20auto-DL=20d=C3=A9clenche=20un=20check=20?= =?UTF-8?q?imm=C3=A9diat=20=C3=A0=20l'activation=20avec=20feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- static/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/app.js b/static/app.js index a77d968..c90f00f 100644 --- a/static/app.js +++ b/static/app.js @@ -82,6 +82,16 @@ async function toggleAutoDl(cat, iconEl) { await fetch(`/api/auto-dl/${encodeURIComponent(cat)}`, { method: isActive ? 'DELETE' : 'POST' }); iconEl.classList.toggle('active', !isActive); iconEl.title = !isActive ? 'Auto-DL actif — cliquer pour désactiver' : 'Activer le téléchargement automatique'; + + if (!isActive) { + statusText.textContent = `Auto-DL ${cat} : vérification en cours…`; + const { enqueued } = await fetch('/api/auto-dl/check', { method: 'POST' }).then(r => r.json()); + statusText.textContent = enqueued > 0 + ? `Auto-DL ${cat} : ${enqueued} concert${enqueued > 1 ? 's' : ''} ajouté${enqueued > 1 ? 's' : ''} à la file.` + : `Auto-DL ${cat} activé — aucun nouveau concert pour l'instant.`; + } else { + statusText.textContent = `Auto-DL ${cat} désactivé.`; + } } catch {} }