mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
3779e3a3b6
commit
381568a60f
@ -22,7 +22,7 @@ interface SearchBookDao {
|
||||
and t2.enabled = 1 and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
||||
order by t2.customOrder"""
|
||||
)
|
||||
fun getChangeSourceSearch(name: String, author: String, sourceGroup: String): List<SearchBook>
|
||||
fun changeSourceByGroup(name: String, author: String, sourceGroup: String): List<SearchBook>
|
||||
|
||||
@Query(
|
||||
"""select t1.name, t1.author, t1.origin, t1.originName, t1.coverUrl, t1.bookUrl,
|
||||
@ -31,11 +31,12 @@ interface SearchBookDao {
|
||||
from searchBooks as t1 inner join book_sources as t2
|
||||
on t1.origin = t2.bookSourceUrl
|
||||
where t1.name = :name and t1.author like '%'||:author||'%'
|
||||
and originName like '%'||:key||'%' and t2.enabled = 1
|
||||
and t2.bookSourceGroup like '%'||:sourceGroup||'%'
|
||||
and (originName like '%'||:key||'%' or t1.latestChapterTitle like '%'||:key||'%')
|
||||
and t2.enabled = 1
|
||||
order by t2.customOrder"""
|
||||
)
|
||||
fun getChangeSourceSearch(
|
||||
fun changeSourceSearch(
|
||||
name: String,
|
||||
author: String,
|
||||
key: String,
|
||||
|
@ -222,21 +222,21 @@ open class ChangeBookSourceViewModel(application: Application) : BaseViewModel(a
|
||||
private fun getDbSearchBooks(): List<SearchBook> {
|
||||
return if (screenKey.isEmpty()) {
|
||||
if (AppConfig.changeSourceCheckAuthor) {
|
||||
appDb.searchBookDao.getChangeSourceSearch(
|
||||
appDb.searchBookDao.changeSourceByGroup(
|
||||
name, author, AppConfig.searchGroup
|
||||
)
|
||||
} else {
|
||||
appDb.searchBookDao.getChangeSourceSearch(
|
||||
appDb.searchBookDao.changeSourceByGroup(
|
||||
name, "", AppConfig.searchGroup
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (AppConfig.changeSourceCheckAuthor) {
|
||||
appDb.searchBookDao.getChangeSourceSearch(
|
||||
appDb.searchBookDao.changeSourceSearch(
|
||||
name, author, screenKey, AppConfig.searchGroup
|
||||
)
|
||||
} else {
|
||||
appDb.searchBookDao.getChangeSourceSearch(
|
||||
appDb.searchBookDao.changeSourceSearch(
|
||||
name, "", screenKey, AppConfig.searchGroup
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user