mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Revert "Support sending floats" and convert DoubleFilter to FloatFilter (#1747)
* Revert "[#1739] Support sending floats (#1740)"
This reverts commit c1f2aae90d.
Closes #1746
* Use `DoubleFilter` for GQL interface, convert to `FloatFilter`
Closes #1739 (again)
This commit is contained in:
@@ -20,8 +20,8 @@ import org.jetbrains.exposed.sql.selectAll
|
||||
import org.jetbrains.exposed.sql.transactions.transaction
|
||||
import suwayomi.tachidesk.graphql.directives.RequireAuth
|
||||
import suwayomi.tachidesk.graphql.queries.filter.BooleanFilter
|
||||
import suwayomi.tachidesk.graphql.queries.filter.DoubleFilter
|
||||
import suwayomi.tachidesk.graphql.queries.filter.Filter
|
||||
import suwayomi.tachidesk.graphql.queries.filter.FloatFilter
|
||||
import suwayomi.tachidesk.graphql.queries.filter.HasGetOp
|
||||
import suwayomi.tachidesk.graphql.queries.filter.IntFilter
|
||||
import suwayomi.tachidesk.graphql.queries.filter.LongFilter
|
||||
@@ -158,7 +158,7 @@ class ChapterQuery {
|
||||
val url: StringFilter? = null,
|
||||
val name: StringFilter? = null,
|
||||
val uploadDate: LongFilter? = null,
|
||||
val chapterNumber: FloatFilter? = null,
|
||||
val chapterNumber: DoubleFilter? = null,
|
||||
val scanlator: StringFilter? = null,
|
||||
val mangaId: IntFilter? = null,
|
||||
val isRead: BooleanFilter? = null,
|
||||
@@ -181,7 +181,7 @@ class ChapterQuery {
|
||||
andFilterWithCompareString(ChapterTable.url, url),
|
||||
andFilterWithCompareString(ChapterTable.name, name),
|
||||
andFilterWithCompare(ChapterTable.date_upload, uploadDate),
|
||||
andFilterWithCompare(ChapterTable.chapter_number, chapterNumber),
|
||||
andFilterWithCompare(ChapterTable.chapter_number, chapterNumber?.toFloatFilter()),
|
||||
andFilterWithCompareString(ChapterTable.scanlator, scanlator),
|
||||
andFilterWithCompareEntity(ChapterTable.manga, mangaId),
|
||||
andFilterWithCompare(ChapterTable.isRead, isRead),
|
||||
|
||||
@@ -304,7 +304,26 @@ data class DoubleFilter(
|
||||
override val lessThanOrEqualTo: Double? = null,
|
||||
override val greaterThan: Double? = null,
|
||||
override val greaterThanOrEqualTo: Double? = null,
|
||||
) : ComparableScalarFilter<Double>
|
||||
) : ComparableScalarFilter<Double> {
|
||||
fun toFloatFilter(): FloatFilter =
|
||||
FloatFilter(
|
||||
isNull = isNull,
|
||||
equalTo = equalTo?.toFloat(),
|
||||
notEqualTo = notEqualTo?.toFloat(),
|
||||
notEqualToAll = notEqualToAll?.map { it.toFloat() },
|
||||
notEqualToAny = notEqualToAny?.map { it.toFloat() },
|
||||
distinctFrom = distinctFrom?.toFloat(),
|
||||
distinctFromAll = distinctFromAll?.map { it.toFloat() },
|
||||
distinctFromAny = distinctFromAny?.map { it.toFloat() },
|
||||
notDistinctFrom = notDistinctFrom?.toFloat(),
|
||||
`in` = `in`?.map { it.toFloat() },
|
||||
notIn = notIn?.map { it.toFloat() },
|
||||
lessThan = lessThan?.toFloat(),
|
||||
lessThanOrEqualTo = lessThanOrEqualTo?.toFloat(),
|
||||
greaterThan = greaterThan?.toFloat(),
|
||||
greaterThanOrEqualTo = greaterThanOrEqualTo?.toFloat(),
|
||||
)
|
||||
}
|
||||
|
||||
data class StringFilter(
|
||||
override val isNull: Boolean? = null,
|
||||
|
||||
Reference in New Issue
Block a user