From b1e104319f90678bc7ed501797d9d7d5b98902b5 Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:17:45 +0800 Subject: [PATCH] Fix download progress indicator (#8188) --- .../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 3ed404f4a3..935fd4135d 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 @@ -316,13 +316,14 @@ class Downloader( val pageListObservable = if (download.pages == null) { // Pull page list from network and add them to download object download.source.fetchPageList(download.chapter) - .doOnNext { pages -> + .map { pages -> if (pages.isEmpty()) { throw Exception(context.getString(R.string.page_list_empty_error)) } // Don't trust index from source val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) } download.pages = reIndexedPages + reIndexedPages } } else { // Or if the page list already exists, start from the file