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) } }