From 759795940b78d3791c2d2f765f5762d27c79a8ef Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 30 May 2020 18:20:19 -0400 Subject: [PATCH] Use onBackpressureLatest for chapter/page download observables (maybe fixes #3229) --- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ae47453eb2..ec8abac843 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 @@ -191,7 +191,7 @@ class Downloader( }, 5 ) - .onBackpressureBuffer() + .onBackpressureLatest() .observeOn(AndroidSchedulers.mainThread()) .subscribe( { @@ -300,6 +300,7 @@ class Downloader( // Start downloading images, consider we can have downloaded images already // Concurrently do 5 pages at a time .flatMap({ page -> getOrDownloadImage(page, download, tmpDir) }, 5) + .onBackpressureLatest() // Do when page is downloaded. .doOnNext { notifier.onProgressChange(download) } .toList()