mirror of
https://github.com/gotson/komga.git
synced 2026-04-22 15:00:59 +02:00
added endpoint for serie thumbnail
This commit is contained in:
parent
cb867ff519
commit
5619661d95
1 changed files with 9 additions and 0 deletions
|
|
@ -64,6 +64,15 @@ class SerieController(
|
|||
): SerieDto =
|
||||
serieRepository.findByIdOrNull(id)?.toDto() ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
|
||||
@GetMapping(value = ["{serieId}/thumbnail"], produces = [MediaType.IMAGE_PNG_VALUE])
|
||||
fun getSerieThumbnail(
|
||||
@PathVariable serieId: Long
|
||||
): ByteArray {
|
||||
return serieRepository.findByIdOrNull(serieId)?.let {
|
||||
it.books.firstOrNull()?.metadata?.thumbnail ?: throw ResponseStatusException(HttpStatus.NO_CONTENT)
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
}
|
||||
|
||||
@GetMapping("{id}/books")
|
||||
fun getAllBooksBySerie(
|
||||
@PathVariable id: Long,
|
||||
|
|
|
|||
Loading…
Reference in a new issue