From 2766de5b9d078824c70baafedd447b9feb0152cd Mon Sep 17 00:00:00 2001 From: Gaspard Jankowiak Date: Fri, 5 Jun 2026 13:38:45 +0200 Subject: [PATCH] count the files downloaded instead of remaining --- content.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/content.js b/content.js index 852600a..f3b8aea 100644 --- a/content.js +++ b/content.js @@ -320,7 +320,7 @@ function createProgressDialog() { const list = document.createElement("ul") const summary = document.createElement("div") const elapsed = document.createElement("p") - const remaining = document.createElement("p") + const downloaded = document.createElement("p") const size = document.createElement("p") const actions = document.createElement("div") const closeButton = document.createElement("button") @@ -336,7 +336,7 @@ function createProgressDialog() { list.classList.add("ripper-progress-list") summary.classList.add("ripper-progress-summary") elapsed.classList.add("ripper-progress-elapsed") - remaining.classList.add("ripper-progress-remaining") + downloaded.classList.add("ripper-progress-downloaded") size.classList.add("ripper-progress-size") actions.classList.add("ripper-progress-actions") @@ -346,10 +346,9 @@ function createProgressDialog() { const totalDownloaded = progressValues.reduce((sum, entry) => sum + (entry.downloaded ?? 0), 0) const totalFiles = progressValues.reduce((sum, entry) => sum + (entry.total ?? 0), 0) const totalDownloadedBytes = progressValues.reduce((sum, entry) => sum + (entry.bytes ?? 0), 0) - const filesRemaining = Math.max(totalFiles - totalDownloaded, 0) elapsed.textContent = `Time elapsed: ${formatElapsedTime(startTime)}` - remaining.textContent = hasUnknownTotals ? "Files remaining: ?" : `Files remaining: ${filesRemaining}` + downloaded.textContent = hasUnknownTotals ? `Files downloaded: ${totalDownloaded}/?` : `Files downloaded: ${totalDownloaded}/${totalFiles}` size.textContent = `Downloaded size: ${formatMegabytes(totalDownloadedBytes)}` } @@ -368,7 +367,7 @@ function createProgressDialog() { }) actions.append(closeButton) - summary.append(elapsed, remaining, size) + summary.append(elapsed, downloaded, size) dialog.append(title, status, list, summary, actions) document.body.append(dialog) dialog.showModal()