From 8a13e900ec1335a3bd3918938d501bb349b16682 Mon Sep 17 00:00:00 2001 From: niuhb <76513019+niu-hb@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E7=9A=84=E5=88=86=E7=BB=84=20(#4562)?= 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 0c3fd7fc1..630843653 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 @@ -26,7 +26,8 @@ interface BookGroupDao { @get:Query( """ 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) + SELECT book_groups.* FROM book_groups, const + where (groupId >= 0 and show > 0 and exists (select `group` from books where books.`group` = book_groups.groupId)) or (groupId = -1 and show > 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)