Skip to content

Commit

Permalink
feat(api): add read_status parameter to series books
Browse files Browse the repository at this point in the history
related to gotson#25
  • Loading branch information
gotson committed Jun 5, 2020
1 parent 0d2713a commit fc5c502
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import mu.KotlinLogging
import org.gotson.komga.application.tasks.TaskReceiver
import org.gotson.komga.domain.model.BookSearchWithReadProgress
import org.gotson.komga.domain.model.Media
import org.gotson.komga.domain.model.ReadStatus
import org.gotson.komga.domain.model.SeriesMetadata
import org.gotson.komga.domain.model.SeriesSearch
import org.gotson.komga.domain.persistence.BookRepository
Expand Down Expand Up @@ -184,6 +185,7 @@ class SeriesController(
@AuthenticationPrincipal principal: KomgaPrincipal,
@PathVariable(name = "seriesId") seriesId: Long,
@RequestParam(name = "media_status", required = false) mediaStatus: List<Media.Status>?,
@RequestParam(name = "read_status", required = false) readStatus: List<ReadStatus>?,
@Parameter(hidden = true) page: Pageable
): Page<BookDto> {
seriesRepository.getLibraryId(seriesId)?.let {
Expand All @@ -200,7 +202,8 @@ class SeriesController(
return bookDtoRepository.findAll(
BookSearchWithReadProgress(
seriesIds = listOf(seriesId),
mediaStatus = mediaStatus ?: emptyList()
mediaStatus = mediaStatus ?: emptyList(),
readStatus = readStatus ?: emptyList()
),
principal.user.id,
pageRequest
Expand Down

0 comments on commit fc5c502

Please sign in to comment.