fix(app/download_processor): negative estimated size

This commit is contained in:
rhunk
2024-04-10 22:01:22 +02:00
parent a301217e62
commit 79a58ee89e

View File

@@ -173,7 +173,7 @@ class DownloadProcessor (
fun updateDownloadProgress() {
pendingTask.updateProgress(
inputMediaProgress.values.joinToString("\n"),
progress = (inputMediaDownloadedBytes.values.sum() * 100 / totalSize).toInt().coerceIn(0, 100)
progress = (inputMediaDownloadedBytes.values.sum() * 100 / totalSize.coerceAtLeast(1)).toInt().coerceIn(0, 100)
)
}