This commit is contained in:
Horis 2024-04-10 14:31:02 +08:00
parent cc75fc9394
commit ad0aeab06e
2 changed files with 1 additions and 9 deletions

View File

@ -288,14 +288,6 @@ data class Book(
return appDb.bookSourceDao.getBookSource(origin)
}
fun getChapter(index: Int): BookChapter? {
return appDb.bookChapterDao.getChapter(bookUrl, index)
}
fun getDurChapter(): BookChapter? {
return getChapter(durChapterIndex)
}
fun isLocalModified(): Boolean {
return isLocal && LocalBook.getLastModified(this).getOrDefault(0L) > latestChapterTime
}

View File

@ -84,7 +84,7 @@ object AudioPlay {
* 更新当前章节
*/
fun upDurChapter(book: Book) {
durChapter = book.getDurChapter()
durChapter = appDb.bookChapterDao.getChapter(book.bookUrl, book.durChapterIndex)
postEvent(EventBus.AUDIO_SUB_TITLE, durChapter?.title ?: "")
postEvent(EventBus.AUDIO_SIZE, durChapter?.end?.toInt() ?: 0)
postEvent(EventBus.AUDIO_PROGRESS, book.durChapterPos)