Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Apr 10, 2024
1 parent cc75fc9 commit ad0aeab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions app/src/main/java/io/legado/app/data/entities/Book.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/legado/app/model/AudioPlay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ad0aeab

Please sign in to comment.