From db8835a7b8df34848e90966fbaa5d7727ae53f74 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Fri, 27 Oct 2023 14:18:14 +0300 Subject: [PATCH] Fix history restoring --- .../org/koitharu/kotatsu/history/data/HistoryRepository.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryRepository.kt b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryRepository.kt index fd64610e1..29d7aae76 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryRepository.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/history/data/HistoryRepository.kt @@ -15,6 +15,7 @@ import org.koitharu.kotatsu.core.db.entity.toMangaTag import org.koitharu.kotatsu.core.db.entity.toMangaTags import org.koitharu.kotatsu.core.model.MangaHistory import org.koitharu.kotatsu.core.model.findById +import org.koitharu.kotatsu.core.model.isLocal import org.koitharu.kotatsu.core.prefs.AppSettings import org.koitharu.kotatsu.core.ui.util.ReversibleHandle import org.koitharu.kotatsu.core.util.ext.mapItems @@ -185,7 +186,7 @@ class HistoryRepository @Inject constructor( private suspend fun HistoryEntity.recoverIfNeeded(manga: Manga): HistoryEntity { val chapters = manga.chapters - if (chapters.isNullOrEmpty() || chapters.findById(chapterId) != null) { + if (manga.isLocal || chapters.isNullOrEmpty() || chapters.findById(chapterId) != null) { return this } val newChapterId = chapters.getOrNull(