From cc2d7be3373a13043ee5c4cbca136c26b1481145 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 18 Aug 2019 09:38:49 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt | 2 +- .../java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt b/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt index 13fa0700e..a197b0e51 100644 --- a/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt @@ -29,7 +29,7 @@ interface SearchBookDao { @Query("select * from searchBooks where name = :name and author = :author order by originOrder") fun getByNameAuthor(name: String, author: String): List - @Query("select * from searchBooks where name = :name and author = :author order by originOrder") + @Query("select * from searchBooks where name = :name and author = :author and origin in (select bookSourceUrl from book_sources where enabled = 1) order by originOrder") fun getByNameAuthorEnable(name: String, author: String): List @Insert(onConflict = OnConflictStrategy.REPLACE) diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt index be95f7065..579d79bb2 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt @@ -14,7 +14,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio fun startSearch() { execute { - App.db.searchBookDao().getByNameAuthor(name, author).let { + App.db.searchBookDao().getByNameAuthorEnable(name, author).let { searchBookData.postValue(it) } }