优化
This commit is contained in:
@@ -10,6 +10,7 @@ import io.legado.app.data.appDb
|
|||||||
import io.legado.app.data.entities.Book
|
import io.legado.app.data.entities.Book
|
||||||
import io.legado.app.data.entities.BookChapter
|
import io.legado.app.data.entities.BookChapter
|
||||||
import io.legado.app.data.entities.BookSource
|
import io.legado.app.data.entities.BookSource
|
||||||
|
import io.legado.app.help.ContentProcessor
|
||||||
import io.legado.app.help.coroutine.Coroutine
|
import io.legado.app.help.coroutine.Coroutine
|
||||||
import io.legado.app.service.AudioPlayService
|
import io.legado.app.service.AudioPlayService
|
||||||
import io.legado.app.utils.postEvent
|
import io.legado.app.utils.postEvent
|
||||||
@@ -148,7 +149,9 @@ object AudioPlay {
|
|||||||
book.durChapterTime = System.currentTimeMillis()
|
book.durChapterTime = System.currentTimeMillis()
|
||||||
Coroutine.async {
|
Coroutine.async {
|
||||||
appDb.bookChapterDao.getChapter(book.bookUrl, book.durChapterIndex)?.let {
|
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()
|
book.save()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import kotlinx.coroutines.delay
|
|||||||
import splitties.init.appCtx
|
import splitties.init.appCtx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Suppress("MemberVisibilityCanBePrivate")
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
object ReadBook : CoroutineScope by MainScope() {
|
object ReadBook : CoroutineScope by MainScope() {
|
||||||
var book: Book? = null
|
var book: Book? = null
|
||||||
@@ -422,7 +421,9 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
book.durChapterIndex = durChapterIndex
|
book.durChapterIndex = durChapterIndex
|
||||||
book.durChapterPos = durChapterPos
|
book.durChapterPos = durChapterPos
|
||||||
appDb.bookChapterDao.getChapter(book.bookUrl, durChapterIndex)?.let {
|
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)
|
appDb.bookDao.update(book)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user