From 16cbcecd99c24f87b087dc7d02b8ccc93f1f1251 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 8 Jul 2023 17:56:15 -0400 Subject: [PATCH] Fix download ahead Fixes #9669 --- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index 8825864b92..ac6a5a07db 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -25,6 +25,7 @@ import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.reader.loader.ChapterLoader +import eu.kanade.tachiyomi.ui.reader.loader.DownloadPageLoader import eu.kanade.tachiyomi.ui.reader.model.InsertPage import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderPage @@ -449,7 +450,7 @@ class ReaderViewModel( val manga = manga ?: return // Only download ahead if current + next chapter is already downloaded too to avoid jank - if (getCurrentChapter()?.pageLoader?.isLocal == true) return + if (getCurrentChapter()?.pageLoader !is DownloadPageLoader) return val nextChapter = state.value.viewerChapters?.nextChapter?.chapter ?: return viewModelScope.launchIO {