diff --git a/app/src/main/java/io/legado/app/data/dao/BookDao.kt b/app/src/main/java/io/legado/app/data/dao/BookDao.kt index 58bd7a36c..f1afa562e 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookDao.kt @@ -42,6 +42,9 @@ interface BookDao { @Query("SELECT * FROM books ORDER BY durChapterTime DESC limit 0,10") fun recentRead(): DataSource.Factory + @Query("SELECT * FROM books ORDER BY durChapterTime DESC limit 0,10") + fun getRecentRead(): DataSource.Factory + @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(vararg books: Book) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt index 1bb9a3b64..99f495040 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt @@ -20,4 +20,12 @@ class BookshelfViewModel(application: Application) : BaseViewModel(application) } } + + fun upChapterList() { + execute { + App.db.bookDao().getRecentRead().map { + + } + } + } }