count the files downloaded instead of remaining
This commit is contained in:
parent
bf0ebc78f2
commit
2766de5b9d
1 changed files with 4 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue