This commit is contained in:
kunfei 2022-03-01 09:14:13 +08:00
parent 1afd92427c
commit 85cf6bc8df
2 changed files with 7 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import io.legado.app.data.appDb
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.data.entities.BookSource
import io.legado.app.help.ContentProcessor
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.service.AudioPlayService
import io.legado.app.utils.postEvent
@ -148,7 +149,9 @@ object AudioPlay {
book.durChapterTime = System.currentTimeMillis()
Coroutine.async {
appDb.bookChapterDao.getChapter(book.bookUrl, book.durChapterIndex)?.let {
book.durChapterTitle = it.title
book.durChapterTitle = it.getDisplayTitle(
ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
)
}
book.save()
}

View File

@ -25,7 +25,6 @@ import kotlinx.coroutines.delay
import splitties.init.appCtx
@Suppress("MemberVisibilityCanBePrivate")
object ReadBook : CoroutineScope by MainScope() {
var book: Book? = null
@ -422,7 +421,9 @@ object ReadBook : CoroutineScope by MainScope() {
book.durChapterIndex = durChapterIndex
book.durChapterPos = durChapterPos
appDb.bookChapterDao.getChapter(book.bookUrl, durChapterIndex)?.let {
book.durChapterTitle = it.title
book.durChapterTitle = it.getDisplayTitle(
ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
)
}
appDb.bookDao.update(book)
}