From b635f02d93502f1021f0fe87533dfd96d052ed2f Mon Sep 17 00:00:00 2001 From: f1998f1998 <71004883+f1998f1998@users.noreply.github.com> Date: Mon, 18 Jul 2022 23:22:09 +0600 Subject: [PATCH] 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 Co-authored-by: Vetle Ledaal --- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index 7711a1cba..0b4b61731 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -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) }