mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-03 14:50:49 +00:00
Merge branch 'download-fixes' into 'master'
Download fixes See merge request videostreaming/grayjay!33
This commit is contained in:
commit
6ab3eff61c
2 changed files with 10 additions and 5 deletions
|
@ -706,7 +706,12 @@ class VideoDownload {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Logger.i(TAG, "Download $name Sequential");
|
Logger.i(TAG, "Download $name Sequential");
|
||||||
|
try {
|
||||||
sourceLength = downloadSource_Sequential(client, fileStream, videoUrl, onProgress);
|
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");
|
||||||
|
@ -762,7 +767,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++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(30))
|
||||||
.writeTimeout(Duration.ofSeconds(30))
|
.writeTimeout(Duration.ofMinutes(30))
|
||||||
.connectTimeout(Duration.ofSeconds(30))
|
.connectTimeout(Duration.ofSeconds(30))
|
||||||
.callTimeout(Duration.ofMinutes(30)))
|
.callTimeout(Duration.ofMinutes(0)))
|
||||||
|
|
||||||
private var _started = false;
|
private var _started = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue