Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Dec 8, 2024
1 parent 5892d5c commit e105582
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/io/legado/app/help/book/BookExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import java.io.File
import java.time.LocalDate
import java.time.Period.between
import java.util.concurrent.ConcurrentHashMap
import kotlin.collections.set
import kotlin.math.max
import kotlin.math.min

Expand Down Expand Up @@ -242,9 +241,14 @@ fun BookSource.getBookType(): Int {
fun Book.sync(oldBook: Book) {
val curBook = appDb.bookDao.getBook(oldBook.bookUrl)!!
durChapterTime = curBook.durChapterTime
durChapterIndex = curBook.durChapterIndex
durChapterPos = curBook.durChapterPos
durChapterTitle = curBook.durChapterTitle
if (durChapterIndex != curBook.durChapterIndex) {
durChapterIndex = curBook.durChapterIndex
val replaceRules = ContentProcessor.get(this).getTitleReplaceRules()
appDb.bookChapterDao.getChapter(bookUrl, durChapterIndex)?.let {
durChapterTitle = it.getDisplayTitle(replaceRules, getUseReplaceRule())
}
}
canUpdate = curBook.canUpdate
}

Expand Down

0 comments on commit e105582

Please sign in to comment.