Horis 2 лет назад
Родитель
Сommit
b1da2ec309

+ 0 - 8
app/src/main/java/io/legado/app/data/entities/Book.kt

@@ -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
     }

+ 1 - 1
app/src/main/java/io/legado/app/model/AudioPlay.kt

@@ -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)