Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay

This commit is contained in:
Kelvin 2024-08-29 19:52:50 +02:00
commit e9ff5e6f0b
2 changed files with 11 additions and 6 deletions

View file

@ -713,7 +713,12 @@ class VideoDownload {
} }
else { else {
Logger.i(TAG, "Download $name Sequential"); Logger.i(TAG, "Download $name Sequential");
sourceLength = downloadSource_Sequential(client, fileStream, videoUrl, onProgress); try {
sourceLength = downloadSource_Sequential(client, fileStream, videoUrl, onProgress);
} catch (e: Throwable) {
Logger.w(TAG, "Failed to download sequentially (url = $videoUrl)")
throw e
}
} }
Logger.i(TAG, "$name downloadSource Finished"); Logger.i(TAG, "$name downloadSource Finished");
@ -769,7 +774,7 @@ class VideoDownload {
totalRead += read; totalRead += read;
readSinceLastSpeedTest += read; readSinceLastSpeedTest += read;
if (totalRead / progressRate > lastProgressCount) { if (totalRead.toDouble() / progressRate > lastProgressCount) {
onProgress(sourceLength, totalRead, lastSpeed); onProgress(sourceLength, totalRead, lastSpeed);
lastProgressCount++; lastProgressCount++;
} }

View file

@ -51,10 +51,10 @@ class DownloadService : Service() {
private val _client = ManagedHttpClient(OkHttpClient.Builder() private val _client = ManagedHttpClient(OkHttpClient.Builder()
//.proxy(Proxy(Proxy.Type.HTTP, InetSocketAddress(InetAddress.getByName("192.168.1.175"), 8081))) //.proxy(Proxy(Proxy.Type.HTTP, InetSocketAddress(InetAddress.getByName("192.168.1.175"), 8081)))
.readTimeout(Duration.ofSeconds(30)) .readTimeout(Duration.ofMinutes(0))
.writeTimeout(Duration.ofSeconds(30)) .writeTimeout(Duration.ofMinutes(0))
.connectTimeout(Duration.ofSeconds(30)) .connectTimeout(Duration.ofSeconds(100))
.callTimeout(Duration.ofMinutes(30))) .callTimeout(Duration.ofMinutes(0)))
private var _started = false; private var _started = false;