mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 11:19:09 +01:00
Concurrently download up to 5 pages at a time
This commit is contained in:
parent
f96f25b1f6
commit
f2fe1a7c23
@ -294,7 +294,8 @@ class Downloader(
|
|||||||
// Get all the URLs to the source images, fetch pages if necessary
|
// Get all the URLs to the source images, fetch pages if necessary
|
||||||
.flatMap { download.source.fetchAllImageUrlsFromPageList(it) }
|
.flatMap { download.source.fetchAllImageUrlsFromPageList(it) }
|
||||||
// Start downloading images, consider we can have downloaded images already
|
// Start downloading images, consider we can have downloaded images already
|
||||||
.concatMap { page -> getOrDownloadImage(page, download, tmpDir) }
|
// Concurrently do 5 pages at a time
|
||||||
|
.flatMap({ page -> getOrDownloadImage(page, download, tmpDir) }, 5)
|
||||||
// Do when page is downloaded.
|
// Do when page is downloaded.
|
||||||
.doOnNext { notifier.onProgressChange(download) }.toList().map { _ -> download }
|
.doOnNext { notifier.onProgressChange(download) }.toList().map { _ -> download }
|
||||||
// Do after download completes
|
// Do after download completes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user