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 38cc452f2..d0588bec8 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 @@ -10,16 +10,16 @@ import io.legado.app.data.entities.BookChapter @Dao interface BookChapterDao { - @Query("select * from chapters where bookUrl = :bookUrl") + @Query("select * from chapters where bookUrl = :bookUrl order by `index`") fun observeByBook(bookUrl: String): LiveData> - @Query("SELECT * FROM chapters where bookUrl = :bookUrl and title like '%'||:key||'%'") + @Query("SELECT * FROM chapters where bookUrl = :bookUrl and title like '%'||:key||'%' order by `index`") fun liveDataSearch(bookUrl: String, key: String): LiveData> - @Query("select * from chapters where bookUrl = :bookUrl") + @Query("select * from chapters where bookUrl = :bookUrl order by `index`") fun getChapterList(bookUrl: String): List - @Query("select * from chapters where bookUrl = :bookUrl and `index` >= :start and `index` <= :end") + @Query("select * from chapters where bookUrl = :bookUrl and `index` >= :start and `index` <= :end order by `index`") fun getChapterList(bookUrl: String, start: Int, end: Int): List @Query("select * from chapters where bookUrl = :bookUrl and `index` = :index")