feat: allow re-downloading already-downloaded concerts
Docker / docker (push) Successful in 1m27s

Replace disabled "Déjà téléchargé" with active "Re-télécharger" button
(ghost style to distinguish from first download).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
dev
2026-05-15 17:06:16 +02:00
parent 0173681786
commit 5701a7d60a
2 changed files with 15 additions and 13 deletions
+12 -12
View File
@@ -250,18 +250,15 @@ function openModal(concert) {
const btnDl = $('btn-download');
const alreadyDone = state.downloadedUrls.has(concert.url);
btnDl.textContent = alreadyDone ? '✓ Déjà téléchargé' : 'Télécharger';
btnDl.prepend((() => {
const s = document.createElementNS('http://www.w3.org/2000/svg','svg');
s.setAttribute('viewBox','0 0 20 20'); s.setAttribute('fill','none');
s.setAttribute('width','16'); s.setAttribute('height','16');
if (!alreadyDone) {
s.innerHTML = `<path d="M10 3v9M7 9l3 3 3-3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
btnDl.textContent = alreadyDone ? 'Re-télécharger' : 'Télécharger';
btnDl.classList.toggle('btn-redownload', alreadyDone);
const dlIcon = document.createElementNS('http://www.w3.org/2000/svg','svg');
dlIcon.setAttribute('viewBox','0 0 20 20'); dlIcon.setAttribute('fill','none');
dlIcon.setAttribute('width','16'); dlIcon.setAttribute('height','16');
dlIcon.innerHTML = `<path d="M10 3v9M7 9l3 3 3-3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4 15h12" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;
}
return s;
})());
btnDl.disabled = alreadyDone;
btnDl.prepend(dlIcon);
btnDl.disabled = false;
$('dl-progress-wrap').hidden = true;
$('dl-progress-fill').style.width = '0%';
@@ -342,7 +339,10 @@ function trackDownload(id, title, url) {
$('dl-progress-label').textContent = `${Math.round(pct)}%`;
if (s.state === 'done') {
$('dl-progress-label').textContent = '✓ Terminé';
$('btn-download').textContent = '✓ Téléchargé';
const b = $('btn-download');
b.textContent = 'Re-télécharger';
b.classList.add('btn-redownload');
b.disabled = false;
}
}
+2
View File
@@ -629,6 +629,8 @@ body {
.btn-download:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-download:active { transform: none; }
.btn-download:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-download.btn-redownload { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-download.btn-redownload:hover { color: var(--text); border-color: var(--text-muted); opacity: 1; }
.btn-watch {
color: var(--text-dim);