mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 02:39:16 +01:00
Use onBackpressureLatest for chapter/page download observables (maybe fixes #3229)
This commit is contained in:
parent
a23d5ab734
commit
759795940b
@ -191,7 +191,7 @@ class Downloader(
|
|||||||
},
|
},
|
||||||
5
|
5
|
||||||
)
|
)
|
||||||
.onBackpressureBuffer()
|
.onBackpressureLatest()
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
{
|
{
|
||||||
@ -300,6 +300,7 @@ class Downloader(
|
|||||||
// Start downloading images, consider we can have downloaded images already
|
// Start downloading images, consider we can have downloaded images already
|
||||||
// Concurrently do 5 pages at a time
|
// Concurrently do 5 pages at a time
|
||||||
.flatMap({ page -> getOrDownloadImage(page, download, tmpDir) }, 5)
|
.flatMap({ page -> getOrDownloadImage(page, download, tmpDir) }, 5)
|
||||||
|
.onBackpressureLatest()
|
||||||
// Do when page is downloaded.
|
// Do when page is downloaded.
|
||||||
.doOnNext { notifier.onProgressChange(download) }
|
.doOnNext { notifier.onProgressChange(download) }
|
||||||
.toList()
|
.toList()
|
||||||
|
Loading…
Reference in New Issue
Block a user