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 <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user