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 74a9c564b..d2bf9ff5f 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 @@ -6,7 +6,8 @@ open class SeriesSearch( val searchTerm: String? = null, val metadataStatus: Collection? = null, val publishers: Collection? = null, - val languages: Collection? = null + val languages: Collection? = null, + val tags: Collection? = null ) class SeriesSearchWithReadProgress( @@ -16,5 +17,6 @@ class SeriesSearchWithReadProgress( metadataStatus: Collection? = null, publishers: Collection? = null, languages: Collection? = null, + tags: Collection? = null, val readStatus: Collection? = null -) : SeriesSearch(libraryIds, collectionIds, searchTerm, metadataStatus, publishers, languages) +) : SeriesSearch(libraryIds, collectionIds, searchTerm, metadataStatus, publishers, languages, 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 99924e73f..ae689b4b2 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(st).on(s.ID.eq(st.SERIES_ID)) .and(readProgressCondition(userId)) .leftJoin(cs).on(s.ID.eq(cs.SERIES_ID)) @@ -114,6 +115,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(st).on(s.ID.eq(st.SERIES_ID)) .and(readProgressCondition(userId)) .leftJoin(cs).on(s.ID.eq(cs.SERIES_ID)) .where(conditions) @@ -187,6 +189,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() })) } + 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 c8db52c54..41555799b 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 = "tag", required = false) tags: List?, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @Parameter(hidden = true) page: Pageable ): Page { @@ -101,7 +102,8 @@ class SeriesController( metadataStatus = metadataStatus, readStatus = readStatus, publishers = publishers, - languages = languages + languages = languages, + tags = tags ) return seriesDtoRepository.findAll(seriesSearch, principal.user.id, pageRequest)