pull/52/head
kunfei 5 years ago
parent 753426d271
commit 786f244568
  1. 2
      app/src/main/java/io/legado/app/data/dao/BookDao.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt

@ -33,7 +33,7 @@ interface BookDao {
fun getBook(bookUrl: String): Book?
@get:Query("SELECT * FROM books where origin <> '${BookType.local}'")
val webBooks: List<Book>
val hasUpdateBooks: List<Book>
@get:Query("SELECT * FROM books")
val allBooks: List<Book>

@ -35,7 +35,7 @@ class BookshelfViewModel(application: Application) : BaseViewModel(application)
fun downloadAll() {
execute {
App.db.bookDao().webBooks.forEach { book ->
App.db.bookDao().hasUpdateBooks.forEach { book ->
Download.start(context, book.bookUrl, book.durChapterIndex, book.totalChapterNum)
}
}

Loading…
Cancel
Save