Browse Source

Use onBackpressureLatest for chapter/page download observables (maybe fixes #3229)

arkon 4 years ago
parent
commit
759795940b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt

+ 2 - 1
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()