mirror of
https://github.com/gotson/komga.git
synced 2026-01-04 23:02:56 +01:00
refactor: remove duplicated code
This commit is contained in:
parent
0dd4b270ef
commit
274ac6aae1
2 changed files with 2 additions and 3 deletions
|
|
@ -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 a new issue