Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove category filter #551

Merged
merged 1 commit into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import suwayomi.tachidesk.graphql.server.primitives.lessNotUnique
import suwayomi.tachidesk.graphql.server.primitives.maybeSwap
import suwayomi.tachidesk.graphql.types.MangaNodeList
import suwayomi.tachidesk.graphql.types.MangaType
import suwayomi.tachidesk.manga.model.table.CategoryMangaTable
import suwayomi.tachidesk.manga.model.table.MangaStatus
import suwayomi.tachidesk.manga.model.table.MangaTable
import java.util.concurrent.CompletableFuture
Expand Down Expand Up @@ -172,7 +171,6 @@ class MangaQuery {
val realUrl: StringFilter? = null,
val lastFetchedAt: LongFilter? = null,
val chaptersLastFetchedAt: LongFilter? = null,
val category: IntFilter? = null,
override val and: List<MangaFilter>? = null,
override val or: List<MangaFilter>? = null,
override val not: MangaFilter? = null
Expand All @@ -196,8 +194,6 @@ class MangaQuery {
andFilterWithCompare(MangaTable.inLibraryAt, chaptersLastFetchedAt)
)
}

fun getCategoryOp() = andFilterWithCompareEntity(CategoryMangaTable.category, category)
}

fun mangas(
Expand All @@ -214,14 +210,6 @@ class MangaQuery {
val queryResults = transaction {
val res = MangaTable.selectAll()

val categoryOp = filter?.getCategoryOp()
if (categoryOp != null) {
res.adjustColumnSet {
innerJoin(CategoryMangaTable)
}
res.andWhere { categoryOp }
}

res.applyOps(condition, filter)

if (orderBy != null || (last != null || before != null)) {
Expand Down