mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-27 16:26:29 +03:00
fix concurrent download (#7552)
* Fix concurrent download
* lower Concurrency
* artist Update app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
Co-authored-by: Vetle Ledaal <vetle.ledaal@gmail.com>
(cherry picked from commit b635f02d93
)
This commit is contained in:
parent
7c7bd72c8e
commit
dd676b6d14
1 changed files with 2 additions and 2 deletions
|
@ -341,8 +341,8 @@ class Downloader(
|
|||
// Get all the URLs to the source images, fetch pages if necessary
|
||||
.flatMap { download.source.fetchAllImageUrlsFromPageList(it) }
|
||||
// Start downloading images, consider we can have downloaded images already
|
||||
// Concurrently do 5 pages at a time
|
||||
.flatMap({ page -> getOrDownloadImage(page, download, tmpDir) }, 5)
|
||||
// Concurrently do 2 pages at a time
|
||||
.flatMap({ page -> getOrDownloadImage(page, download, tmpDir).subscribeOn(Schedulers.io()) }, 2)
|
||||
.onBackpressureLatest()
|
||||
// Do when page is downloaded.
|
||||
.doOnNext { notifier.onProgressChange(download) }
|
||||
|
|
Loading…
Reference in a new issue