mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +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 {
|
||||
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");
|
||||
|
@ -762,7 +767,7 @@ class VideoDownload {
|
|||
totalRead += read;
|
||||
|
||||
readSinceLastSpeedTest += read;
|
||||
if (totalRead / progressRate > lastProgressCount) {
|
||||
if (totalRead.toDouble() / progressRate > lastProgressCount) {
|
||||
onProgress(sourceLength, totalRead, lastSpeed);
|
||||
lastProgressCount++;
|
||||
}
|
||||
|
|
|
@ -51,10 +51,10 @@ class DownloadService : Service() {
|
|||
|
||||
private val _client = ManagedHttpClient(OkHttpClient.Builder()
|
||||
//.proxy(Proxy(Proxy.Type.HTTP, InetSocketAddress(InetAddress.getByName("192.168.1.175"), 8081)))
|
||||
.readTimeout(Duration.ofSeconds(30))
|
||||
.writeTimeout(Duration.ofSeconds(30))
|
||||
.readTimeout(Duration.ofMinutes(30))
|
||||
.writeTimeout(Duration.ofMinutes(30))
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.callTimeout(Duration.ofMinutes(30)))
|
||||
.callTimeout(Duration.ofMinutes(0)))
|
||||
|
||||
private var _started = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue