feat: téléchargement dans sous-dossiers par catégorie

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dev
2026-05-02 19:16:36 +02:00
parent 978a54a25f
commit f07352bd04
3 changed files with 11 additions and 8 deletions
+3 -2
View File
@@ -110,9 +110,10 @@ function renderConcerts(data) {
const dl = state.downloadedUrls.has(c.url) ? `<span class="card-downloaded">✓ Téléchargé</span>` : '';
const date = fmtDate(c.upload_date);
const sub = c.subtitle ? `<div class="card-subtitle">${c.subtitle}</div>` : '';
const downloadedClass = state.downloadedUrls.has(c.url) ? 'downloaded' : '';
return `
<div class="card" data-id="${c.id}" tabindex="0" role="button" aria-label="${c.title}">
<div class="card ${downloadedClass}" data-id="${c.id}" tabindex="0" role="button" aria-label="${c.title}">
<div class="card-thumb-wrap">
${thumb}${dur}${dl}
</div>
@@ -270,7 +271,7 @@ $('btn-download').addEventListener('click', async () => {
const res = await fetch('/api/download', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: c.url, title: c.title, subtitle: c.subtitle || '', year }),
body: JSON.stringify({ url: c.url, title: c.title, subtitle: c.subtitle || '', year, category: state.category }),
});
const { id } = await res.json();
trackDownload(id, c.title, c.url);