From c803b9122398ad02aec14d8997540888a71b4dd2 Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 28 Nov 2015 20:11:56 +0100 Subject: [PATCH] Only preload pages without the image url --- .../java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java index 04de6ee1c..5cbe422c5 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java @@ -183,7 +183,9 @@ public class ReaderPresenter extends BasePresenter { int pagesToPreload = Math.min(pages.size(), 5); return Observable.from(pages) .take(pagesToPreload) - .concatMap(source::getImageUrlFromPage) + .concatMap(page -> page.getImageUrl() == null ? + source.getImageUrlFromPage(page) : + Observable.just(page)) .doOnCompleted(this::stopPreloadingNextChapter); }) .subscribeOn(Schedulers.io())