diff --git a/static/script.js b/static/script.js index 0160629..d0d621c 100644 --- a/static/script.js +++ b/static/script.js @@ -235,7 +235,7 @@ document.addEventListener('DOMContentLoaded', () => { function loadHistory() { const raw = localStorage.getItem('mdl_history'); if(!raw) { - dom.historyTableBody.innerHTML = 'Kein Verlauf vorhanden'; + dom.historyTableBody.innerHTML = 'Kein Verlauf vorhanden'; return; } @@ -258,10 +258,15 @@ document.addEventListener('DOMContentLoaded', () => { tr.innerHTML = ` ${time} ${item.platform} - ${item.title || 'Unbekannt'} + ${item.title || 'Unbekannt'} + + + + + - - + + `; @@ -269,18 +274,21 @@ document.addEventListener('DOMContentLoaded', () => { }); } - function saveHistory(url) { + function saveHistory(resultUrl) { const pf = dom.platformInput.value; + const sourceUrl = dom.urlInput.value; // Hole die Original-URL aus dem Input + const entry = { - url: url, + url: resultUrl, // Der fertige S3 Download Link + source: sourceUrl, // Der ursprüngliche YouTube/etc Link platform: pf, - title: pf + " Download", // Could be improved if backend sent title + title: pf + " Download", // (Backend sendet Titel aktuell nicht im finalen Status, daher generisch) ts: Date.now() }; let data = JSON.parse(localStorage.getItem('mdl_history') || '[]'); data.unshift(entry); - if(data.length > 20) data.pop(); + if(data.length > 20) data.pop(); // Max 20 Einträge localStorage.setItem('mdl_history', JSON.stringify(data)); loadHistory(); } diff --git a/templates/index.html b/templates/index.html index 1c91f48..42421fd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -179,7 +179,8 @@ Zeit Typ Titel - Link + Quelle + Download