mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 16:03:03 +01:00
feat(api): search series by genre
This commit is contained in:
parent
7bd1de6f78
commit
da4a0aa10b
3 changed files with 17 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ open class SeriesSearch(
|
|||
val metadataStatus: Collection<SeriesMetadata.Status>? = null,
|
||||
val publishers: Collection<String>? = null,
|
||||
val languages: Collection<String>? = null,
|
||||
val genres: Collection<String>? = null,
|
||||
val tags: Collection<String>? = null
|
||||
)
|
||||
|
||||
|
|
@ -17,6 +18,16 @@ class SeriesSearchWithReadProgress(
|
|||
metadataStatus: Collection<SeriesMetadata.Status>? = null,
|
||||
publishers: Collection<String>? = null,
|
||||
languages: Collection<String>? = null,
|
||||
genres: Collection<String>? = null,
|
||||
tags: Collection<String>? = null,
|
||||
val readStatus: Collection<ReadStatus>? = 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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ class SeriesController(
|
|||
@RequestParam(name = "read_status", required = false) readStatus: List<ReadStatus>?,
|
||||
@RequestParam(name = "publisher", required = false) publishers: List<String>?,
|
||||
@RequestParam(name = "language", required = false) languages: List<String>?,
|
||||
@RequestParam(name = "genre", required = false) genres: List<String>?,
|
||||
@RequestParam(name = "tag", required = false) tags: List<String>?,
|
||||
@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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue