mirror of
https://github.com/gedoor/legado.git
synced 2025-01-08 11:47:32 +08:00
优化
This commit is contained in:
parent
5892d5cd79
commit
e1055829f1
@ -26,7 +26,6 @@ import java.io.File
|
|||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.Period.between
|
import java.time.Period.between
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
import kotlin.collections.set
|
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
@ -242,9 +241,14 @@ fun BookSource.getBookType(): Int {
|
|||||||
fun Book.sync(oldBook: Book) {
|
fun Book.sync(oldBook: Book) {
|
||||||
val curBook = appDb.bookDao.getBook(oldBook.bookUrl)!!
|
val curBook = appDb.bookDao.getBook(oldBook.bookUrl)!!
|
||||||
durChapterTime = curBook.durChapterTime
|
durChapterTime = curBook.durChapterTime
|
||||||
durChapterIndex = curBook.durChapterIndex
|
|
||||||
durChapterPos = curBook.durChapterPos
|
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
|
canUpdate = curBook.canUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user