From 9466956ae0042a01e86190802c02b36e8086b401 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 20 Oct 2020 09:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=BB=98=E8=AE=A4=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=97=A0=E4=B9=A6=E7=B1=8D=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/data/dao/BookGroupDao.kt | 12 +----------- 1 file changed, 1 insertion(+), 11 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 eb3395a91..e23aa9eb5 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 @@ -2,7 +2,6 @@ package io.legado.app.data.dao import androidx.lifecycle.LiveData import androidx.room.* -import io.legado.app.constant.BookType import io.legado.app.data.entities.BookGroup @Dao @@ -17,16 +16,7 @@ interface BookGroupDao { @Query("SELECT * FROM book_groups ORDER BY `order`") fun liveDataAll(): LiveData> - @Query( - """ - SELECT * FROM book_groups where groupId >= 0 - or (groupId = -4 and show > 0 and (select count(bookUrl) from books where ((SELECT sum(groupId) FROM book_groups where groupId > 0) & `group`) = 0 and type != ${BookType.audio} and origin != '${BookType.local}') > 0) - or (groupId = -3 and show > 0 and (select count(bookUrl) from books where type = ${BookType.audio}) > 0) - or (groupId = -2 and show > 0 and (select count(bookUrl) from books where origin = '${BookType.local}') > 0) - or (groupId = -1 and show > 0) - ORDER BY `order` - """ - ) + @Query("SELECT * FROM book_groups where groupId >= 0 or (groupId < 0 and show > 0) ORDER BY `order`") fun liveDataShow(): LiveData> @Query("SELECT * FROM book_groups where groupId >= 0 ORDER BY `order`")