pull/2368/head
kunfei 2 years ago
parent 96567c95c6
commit ca94434756
  1. 8
      app/src/main/java/io/legado/app/data/dao/BookGroupDao.kt
  2. 2
      app/src/main/java/io/legado/app/model/localBook/LocalBook.kt

@ -23,11 +23,11 @@ interface BookGroupDao {
with const as (SELECT sum(groupId) sumGroupId FROM book_groups where groupId > 0) 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)
or (groupId = -1 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 = -2 and show > 0 and (select count(*) 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 = -3 and show > 0 and (select count(*) from books where type & ${BookType.audio} > 0) > 0)
or (groupId = -4 and show > 0 or (groupId = -4 and show > 0
and ( and (
select count(bookUrl) from books select count(*) from books
where type & ${BookType.audio} = 0 where type & ${BookType.audio} = 0
and type & ${BookType.local} = 0 and type & ${BookType.local} = 0
and const.sumGroupId & `group` = 0 and const.sumGroupId & `group` = 0
@ -35,7 +35,7 @@ interface BookGroupDao {
) )
or (groupId = -5 and show > 0 or (groupId = -5 and show > 0
and ( and (
select count(bookUrl) from books select count(*) from books
where type & ${BookType.audio} = 0 where type & ${BookType.audio} = 0
and type & ${BookType.local} > 0 and type & ${BookType.local} > 0
and const.sumGroupId & `group` = 0 and const.sumGroupId & `group` = 0

@ -148,7 +148,7 @@ object LocalBook {
if (book == null) { if (book == null) {
val nameAuthor = analyzeNameAuthor(fileName) val nameAuthor = analyzeNameAuthor(fileName)
book = Book( book = Book(
type = BookType.text and BookType.local, type = BookType.text or BookType.local,
bookUrl = bookUrl, bookUrl = bookUrl,
name = nameAuthor.first, name = nameAuthor.first,
author = nameAuthor.second, author = nameAuthor.second,

Loading…
Cancel
Save