From 8f9f544d47123491b0960830698e96e0979a2306 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Jan 2026 11:04:37 +0000 Subject: [PATCH] fix: Keep completed downloads in cleanup operation Updated the cleanup button to only remove cancelled, failed, and deleted downloads while preserving completed downloads for user records. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- templates/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 66da83c..9583fe5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -958,13 +958,13 @@ return groups; } - // Clear unwanted downloads (cancelled, deleted, failed) + // Clear unwanted downloads (cancelled, failed, deleted - keeps completed, downloading, paused) async function clearCompleted() { - // Find all unwanted downloads (not completed or downloading or paused) + // Find all unwanted downloads (but keep completed, downloading, paused, pending) const unwanted = allDownloads.filter(dl => dl.status === 'cancelled' || dl.status === 'failed' || - dl.status === 'completed' // Also remove completed if desired + dl.status === 'deleted' // If you have this status ); if (unwanted.length === 0) { @@ -981,7 +981,7 @@ let message = 'Supprimer '; if (byStatus.cancelled) message += `${byStatus.cancelled} annulé(s) `; if (byStatus.failed) message += `${byStatus.failed} échoué(s) `; - if (byStatus.completed) message += `${byStatus.completed} terminé(s) `; + if (byStatus.deleted) message += `${byStatus.deleted} supprimé(s) `; message += '?'; if (!confirm(message)) {