mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:51:50 +01:00
Fix chapter read status not being migrated (fixes #4892)
This commit is contained in:
parent
a598ac3993
commit
7654feb6a8
@ -104,8 +104,7 @@ class SearchPresenter(
|
|||||||
val prevMangaChapters = db.getChapters(prevManga).executeAsBlocking()
|
val prevMangaChapters = db.getChapters(prevManga).executeAsBlocking()
|
||||||
val maxChapterRead = prevMangaChapters
|
val maxChapterRead = prevMangaChapters
|
||||||
.filter { it.read }
|
.filter { it.read }
|
||||||
.maxOfOrNull { it.chapter_number }
|
.maxOfOrNull { it.chapter_number } ?: 0f
|
||||||
if (maxChapterRead != null) {
|
|
||||||
val dbChapters = db.getChapters(manga).executeAsBlocking()
|
val dbChapters = db.getChapters(manga).executeAsBlocking()
|
||||||
for (chapter in dbChapters) {
|
for (chapter in dbChapters) {
|
||||||
if (chapter.isRecognizedNumber) {
|
if (chapter.isRecognizedNumber) {
|
||||||
@ -114,14 +113,14 @@ class SearchPresenter(
|
|||||||
if (prevChapter != null) {
|
if (prevChapter != null) {
|
||||||
chapter.date_fetch = prevChapter.date_fetch
|
chapter.date_fetch = prevChapter.date_fetch
|
||||||
chapter.bookmark = prevChapter.bookmark
|
chapter.bookmark = prevChapter.bookmark
|
||||||
} else if (chapter.chapter_number <= maxChapterRead) {
|
}
|
||||||
|
if (chapter.chapter_number <= maxChapterRead) {
|
||||||
chapter.read = true
|
chapter.read = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
db.insertChapters(dbChapters).executeAsBlocking()
|
db.insertChapters(dbChapters).executeAsBlocking()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Update categories
|
// Update categories
|
||||||
if (migrateCategories) {
|
if (migrateCategories) {
|
||||||
|
Loading…
Reference in New Issue
Block a user