From 0281da1c5a65f57acd18aad7a86d5e4ff087dfd2 Mon Sep 17 00:00:00 2001 From: Koen J Date: Thu, 29 Aug 2024 18:06:53 +0200 Subject: [PATCH] Fixed progress for sequential downloads. --- .../java/com/futo/platformplayer/downloads/VideoDownload.kt | 2 +- .../java/com/futo/platformplayer/services/DownloadService.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/futo/platformplayer/downloads/VideoDownload.kt b/app/src/main/java/com/futo/platformplayer/downloads/VideoDownload.kt index 1b249a74..f961301e 100644 --- a/app/src/main/java/com/futo/platformplayer/downloads/VideoDownload.kt +++ b/app/src/main/java/com/futo/platformplayer/downloads/VideoDownload.kt @@ -767,7 +767,7 @@ class VideoDownload { totalRead += read; readSinceLastSpeedTest += read; - if (totalRead / progressRate > lastProgressCount) { + if (totalRead.toDouble() / progressRate > lastProgressCount) { onProgress(sourceLength, totalRead, lastSpeed); lastProgressCount++; } diff --git a/app/src/main/java/com/futo/platformplayer/services/DownloadService.kt b/app/src/main/java/com/futo/platformplayer/services/DownloadService.kt index e943cecd..04958a29 100644 --- a/app/src/main/java/com/futo/platformplayer/services/DownloadService.kt +++ b/app/src/main/java/com/futo/platformplayer/services/DownloadService.kt @@ -54,7 +54,7 @@ class DownloadService : Service() { .readTimeout(Duration.ofMinutes(30)) .writeTimeout(Duration.ofMinutes(30)) .connectTimeout(Duration.ofSeconds(30)) - .callTimeout(Duration.ofMinutes(30))) + .callTimeout(Duration.ofMinutes(0))) private var _started = false;