mirror of
https://github.com/gotson/komga.git
synced 2025-01-07 03:07:16 +08:00
refactor: remove duplicated code
This commit is contained in:
parent
0dd4b270ef
commit
274ac6aae1
@ -61,8 +61,7 @@ class BookSearchHelper(
|
||||
when (searchCondition.operator) {
|
||||
// for IS condition we have to do a join, so as to order the books by readList number
|
||||
is SearchOperator.Is ->
|
||||
Tables.READLIST_BOOK
|
||||
.`as`("RLB_${searchCondition.operator.value}")
|
||||
rlbAlias(searchCondition.operator.value)
|
||||
.READLIST_ID
|
||||
.eq(searchCondition.operator.value) to setOf(RequiredJoin.ReadList(searchCondition.operator.value))
|
||||
is SearchOperator.IsNot -> {
|
||||
|
@ -134,7 +134,7 @@ class BookDtoDao(
|
||||
} else {
|
||||
if (it.property == "readList.number") {
|
||||
val readListId = joins.filterIsInstance<RequiredJoin.ReadList>().firstOrNull()?.readListId ?: return@mapNotNull null
|
||||
val f = rlb.`as`("RLB_$readListId").NUMBER
|
||||
val f = rlbAlias(readListId).NUMBER
|
||||
if (it.isAscending) f.asc() else f.desc()
|
||||
} else {
|
||||
it.toSortField(sorts)
|
||||
|
Loading…
Reference in New Issue
Block a user