diff --git a/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt b/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt index a0b2b002f..7f42d74d8 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt @@ -1,5 +1,6 @@ package io.legado.app.data.dao +import androidx.paging.DataSource import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy @@ -9,6 +10,9 @@ import io.legado.app.data.entities.BookChapter @Dao interface BookChapterDao { + @Query("select * from chapters where bookUrl = :bookUrl") + fun observeByBook(bookUrl: String): DataSource.Factory + @Query("select * from chapters where bookUrl = :bookUrl and `index` = :index") fun getChapter(bookUrl: String, index: Int): BookChapter?