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 a4ad1d736..cbb1ec990 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 @@ -24,10 +24,10 @@ interface BookDao { @Query("SELECT * FROM books WHERE (`group` & :group) > 0") fun observeByGroup(group: Long): LiveData> - @Query("select * from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") + @Query("select * from books where (SELECT sum(groupId) FROM book_groups where groupId > 0) & `group` = 0") fun observeNoGroup(): LiveData> - @Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") + @Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups where groupId > 0) & `group` = 0") fun observeNoGroupSize(): LiveData @Query("SELECT * FROM books WHERE name like '%'||:key||'%' or author like '%'||:key||'%'")