From 0721f31e2faa0123b1c581afe28c042947bd8e0b Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Fri, 20 Mar 2020 21:18:14 +0800 Subject: [PATCH] fix(api): series thumbnail is of first book by metadata.numberSort --- .../kotlin/org/gotson/komga/interfaces/rest/SeriesController.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ee565aaf7..001508533 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 @@ -177,7 +177,7 @@ class SeriesController( seriesRepository.findByIdOrNull(id)?.let { series -> if (!principal.user.canAccessSeries(series)) throw ResponseStatusException(HttpStatus.UNAUTHORIZED) - series.books.minBy { it.number }?.let { firstBook -> + series.books.minBy { it.metadata.numberSort }?.let { firstBook -> bookController.getBookThumbnail(principal, request, firstBook.id) } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND) } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)