diff --git a/komga/src/main/kotlin/org/gotson/komga/domain/model/SeriesSearch.kt b/komga/src/main/kotlin/org/gotson/komga/domain/model/SeriesSearch.kt index d2bf9ff5f..59000243b 100644 --- a/komga/src/main/kotlin/org/gotson/komga/domain/model/SeriesSearch.kt +++ b/komga/src/main/kotlin/org/gotson/komga/domain/model/SeriesSearch.kt @@ -7,6 +7,7 @@ open class SeriesSearch( val metadataStatus: Collection? = null, val publishers: Collection? = null, val languages: Collection? = null, + val genres: Collection? = null, val tags: Collection? = null ) @@ -17,6 +18,16 @@ class SeriesSearchWithReadProgress( metadataStatus: Collection? = null, publishers: Collection? = null, languages: Collection? = null, + genres: Collection? = null, tags: Collection? = null, val readStatus: Collection? = null -) : SeriesSearch(libraryIds, collectionIds, searchTerm, metadataStatus, publishers, languages, tags) +) : SeriesSearch( + libraryIds = libraryIds, + collectionIds = collectionIds, + searchTerm = searchTerm, + metadataStatus = metadataStatus, + publishers = publishers, + languages = languages, + genres = genres, + tags = tags +) diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt index ae689b4b2..197c9d2f9 100644 --- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt +++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/SeriesDtoDao.kt @@ -105,6 +105,7 @@ class SeriesDtoDao( .leftJoin(b).on(s.ID.eq(b.SERIES_ID)) .leftJoin(d).on(s.ID.eq(d.SERIES_ID)) .leftJoin(r).on(b.ID.eq(r.BOOK_ID)) + .leftJoin(g).on(s.ID.eq(g.SERIES_ID)) .leftJoin(st).on(s.ID.eq(st.SERIES_ID)) .and(readProgressCondition(userId)) .leftJoin(cs).on(s.ID.eq(cs.SERIES_ID)) @@ -115,6 +116,7 @@ class SeriesDtoDao( .leftJoin(b).on(s.ID.eq(b.SERIES_ID)) .leftJoin(d).on(s.ID.eq(d.SERIES_ID)) .leftJoin(r).on(b.ID.eq(r.BOOK_ID)) + .leftJoin(g).on(s.ID.eq(g.SERIES_ID)) .leftJoin(st).on(s.ID.eq(st.SERIES_ID)) .and(readProgressCondition(userId)) .leftJoin(cs).on(s.ID.eq(cs.SERIES_ID)) @@ -189,6 +191,7 @@ class SeriesDtoDao( metadataStatus?.let { c = c.and(d.STATUS.`in`(it)) } publishers?.let { publishers -> c = c.and(lower(d.PUBLISHER).`in`(publishers.map { it.toLowerCase() })) } languages?.let { languages -> c = c.and(lower(d.LANGUAGE).`in`(languages.map { it.toLowerCase() })) } + genres?.let { genres -> c = c.and(lower(g.GENRE).`in`(genres.map { it.toLowerCase() })) } tags?.let { tags -> c = c.and(lower(st.TAG).`in`(tags.map { it.toLowerCase() })) } return c diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/SeriesController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/SeriesController.kt index 41555799b..87e2741d0 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/SeriesController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/SeriesController.kt @@ -79,6 +79,7 @@ class SeriesController( @RequestParam(name = "read_status", required = false) readStatus: List?, @RequestParam(name = "publisher", required = false) publishers: List?, @RequestParam(name = "language", required = false) languages: List?, + @RequestParam(name = "genre", required = false) genres: List?, @RequestParam(name = "tag", required = false) tags: List?, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @Parameter(hidden = true) page: Pageable @@ -103,6 +104,7 @@ class SeriesController( readStatus = readStatus, publishers = publishers, languages = languages, + genres = genres, tags = tags )