From 98c459a6b69a26338d310afe7f2629fa939d6f89 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 1 Oct 2022 21:01:05 +0600 Subject: [PATCH] Downloader: Don't trust index provided by source (#8122) --- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 4 +++- 1 file changed, 3 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 8f99dbb54..3ed404f4a 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 @@ -320,7 +320,9 @@ class Downloader( if (pages.isEmpty()) { throw Exception(context.getString(R.string.page_list_empty_error)) } - download.pages = pages + // Don't trust index from source + val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) } + download.pages = reIndexedPages } } else { // Or if the page list already exists, start from the file