From b25ab941bae6dbef920784db38fb5cd173908fb6 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 26 Apr 2020 16:50:00 -0400 Subject: [PATCH] Include viewer and chapter filter preferences when migrating manga (closes #2866) --- .../eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt index 4563a25596..d5307480dd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt @@ -105,12 +105,14 @@ class SearchPresenter( db.insertChapters(dbChapters).executeAsBlocking() } } + // Update categories if (migrateCategories) { val categories = db.getCategoriesForManga(prevManga).executeAsBlocking() val mangaCategories = categories.map { MangaCategory.create(manga, it) } db.setMangaCategories(mangaCategories, listOf(manga)) } + // Update track if (migrateTracks) { val tracks = db.getTracks(prevManga).executeAsBlocking() @@ -120,6 +122,7 @@ class SearchPresenter( } db.insertTracks(tracks).executeAsBlocking() } + // Update favorite status if (replace) { prevManga.favorite = false @@ -128,6 +131,12 @@ class SearchPresenter( manga.favorite = true db.updateMangaFavorite(manga).executeAsBlocking() + // Update reading preferences + manga.chapter_flags = prevManga.chapter_flags + db.updateFlags(manga).executeAsBlocking() + manga.viewer = prevManga.viewer + db.updateMangaViewer(manga).executeAsBlocking() + // SearchPresenter#networkToLocalManga may have updated the manga title, so ensure db gets updated title db.updateMangaTitle(manga).executeAsBlocking() }