mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Add private to trackrecords filter (#1468)
* Add private to trackrecords filter * Remove sourceMapping from base * Format
This commit is contained in:
@@ -256,6 +256,7 @@ class TrackQuery {
|
||||
SCORE(TrackRecordTable.score),
|
||||
START_DATE(TrackRecordTable.startDate),
|
||||
FINISH_DATE(TrackRecordTable.finishDate),
|
||||
PRIVATE(TrackRecordTable.private),
|
||||
;
|
||||
|
||||
override fun greater(cursor: Cursor): Op<Boolean> =
|
||||
@@ -270,6 +271,7 @@ class TrackQuery {
|
||||
SCORE -> greaterNotUnique(TrackRecordTable.score, TrackRecordTable.id, cursor, String::toDouble)
|
||||
START_DATE -> greaterNotUnique(TrackRecordTable.startDate, TrackRecordTable.id, cursor, String::toLong)
|
||||
FINISH_DATE -> greaterNotUnique(TrackRecordTable.finishDate, TrackRecordTable.id, cursor, String::toLong)
|
||||
PRIVATE -> greaterNotUnique(TrackRecordTable.private, TrackRecordTable.id, cursor, String::toBoolean)
|
||||
}
|
||||
|
||||
override fun less(cursor: Cursor): Op<Boolean> =
|
||||
@@ -284,6 +286,7 @@ class TrackQuery {
|
||||
SCORE -> lessNotUnique(TrackRecordTable.score, TrackRecordTable.id, cursor, String::toDouble)
|
||||
START_DATE -> lessNotUnique(TrackRecordTable.startDate, TrackRecordTable.id, cursor, String::toLong)
|
||||
FINISH_DATE -> lessNotUnique(TrackRecordTable.finishDate, TrackRecordTable.id, cursor, String::toLong)
|
||||
PRIVATE -> lessNotUnique(TrackRecordTable.private, TrackRecordTable.id, cursor, String::toBoolean)
|
||||
}
|
||||
|
||||
override fun asCursor(type: TrackRecordType): Cursor {
|
||||
@@ -299,6 +302,7 @@ class TrackQuery {
|
||||
SCORE -> type.id.toString() + "-" + type.score
|
||||
START_DATE -> type.id.toString() + "-" + type.startDate
|
||||
FINISH_DATE -> type.id.toString() + "-" + type.finishDate
|
||||
PRIVATE -> type.id.toString() + "-" + type.private
|
||||
}
|
||||
return Cursor(value)
|
||||
}
|
||||
@@ -323,6 +327,7 @@ class TrackQuery {
|
||||
val remoteUrl: String? = null,
|
||||
val startDate: Long? = null,
|
||||
val finishDate: Long? = null,
|
||||
val private: Boolean? = null,
|
||||
) : HasGetOp {
|
||||
override fun getOp(): Op<Boolean>? {
|
||||
val opAnd = OpAnd()
|
||||
@@ -339,6 +344,7 @@ class TrackQuery {
|
||||
opAnd.eq(remoteUrl, TrackRecordTable.remoteUrl)
|
||||
opAnd.eq(startDate, TrackRecordTable.startDate)
|
||||
opAnd.eq(finishDate, TrackRecordTable.finishDate)
|
||||
opAnd.eq(private, TrackRecordTable.private)
|
||||
|
||||
return opAnd.op
|
||||
}
|
||||
@@ -358,6 +364,7 @@ class TrackQuery {
|
||||
val remoteUrl: StringFilter? = null,
|
||||
val startDate: LongFilter? = null,
|
||||
val finishDate: LongFilter? = null,
|
||||
val private: BooleanFilter? = null,
|
||||
override val and: List<TrackRecordFilter>? = null,
|
||||
override val or: List<TrackRecordFilter>? = null,
|
||||
override val not: TrackRecordFilter? = null,
|
||||
@@ -377,6 +384,7 @@ class TrackQuery {
|
||||
andFilterWithCompareString(TrackRecordTable.remoteUrl, remoteUrl),
|
||||
andFilterWithCompare(TrackRecordTable.startDate, startDate),
|
||||
andFilterWithCompare(TrackRecordTable.finishDate, finishDate),
|
||||
andFilterWithCompare(TrackRecordTable.private, private),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user