mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
优化
This commit is contained in:
parent
cc75fc9394
commit
ad0aeab06e
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user