From ca94434756e6efa19c1ee0565747491417810905 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 2 Oct 2022 23:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt | 8 ++++---- .../main/java/io/legado/app/model/localBook/LocalBook.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt b/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt index e6c497df5..af3982275 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt @@ -23,11 +23,11 @@ interface BookGroupDao { with const as (SELECT sum(groupId) sumGroupId FROM book_groups where groupId > 0) SELECT book_groups.* FROM book_groups, const where (groupId >= 0 and show > 0) or (groupId = -1 and show > 0) - or (groupId = -2 and show > 0 and (select count(bookUrl) from books where type & ${BookType.local} > 0) > 0) - or (groupId = -3 and show > 0 and (select count(bookUrl) from books where type & ${BookType.audio} > 0) > 0) + or (groupId = -2 and show > 0 and (select count(*) from books where type & ${BookType.local} > 0) > 0) + or (groupId = -3 and show > 0 and (select count(*) from books where type & ${BookType.audio} > 0) > 0) or (groupId = -4 and show > 0 and ( - select count(bookUrl) from books + select count(*) from books where type & ${BookType.audio} = 0 and type & ${BookType.local} = 0 and const.sumGroupId & `group` = 0 @@ -35,7 +35,7 @@ interface BookGroupDao { ) or (groupId = -5 and show > 0 and ( - select count(bookUrl) from books + select count(*) from books where type & ${BookType.audio} = 0 and type & ${BookType.local} > 0 and const.sumGroupId & `group` = 0 diff --git a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt index 0b1b9e0d9..1aa75029a 100644 --- a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt +++ b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt @@ -148,7 +148,7 @@ object LocalBook { if (book == null) { val nameAuthor = analyzeNameAuthor(fileName) book = Book( - type = BookType.text and BookType.local, + type = BookType.text or BookType.local, bookUrl = bookUrl, name = nameAuthor.first, author = nameAuthor.second,