From 57e1222b6e8809c535f6a6e2c67b741184ea133e Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Wed, 8 Apr 2020 09:50:12 +0800 Subject: [PATCH] refactor: remove unused WebRequest parameter --- .../kotlin/org/gotson/komga/interfaces/rest/BookController.kt | 1 - .../org/gotson/komga/interfaces/rest/SeriesController.kt | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/BookController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/BookController.kt index 2c56a37c..dd106238 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/BookController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/rest/BookController.kt @@ -182,7 +182,6 @@ class BookController( ], produces = [MediaType.IMAGE_JPEG_VALUE]) fun getBookThumbnail( @AuthenticationPrincipal principal: KomgaPrincipal, - request: WebRequest, @PathVariable bookId: Long ): ResponseEntity = bookRepository.findByIdOrNull(bookId)?.let { book -> 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 d14bdc3b..1f6e4a32 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 @@ -36,7 +36,6 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController -import org.springframework.web.context.request.WebRequest import org.springframework.web.server.ResponseStatusException import java.util.concurrent.RejectedExecutionException import javax.validation.Valid @@ -171,14 +170,13 @@ class SeriesController( @GetMapping(value = ["{seriesId}/thumbnail"], produces = [MediaType.IMAGE_JPEG_VALUE]) fun getSeriesThumbnail( @AuthenticationPrincipal principal: KomgaPrincipal, - request: WebRequest, @PathVariable(name = "seriesId") id: Long ): ResponseEntity = seriesRepository.findByIdOrNull(id)?.let { series -> if (!principal.user.canAccessSeries(series)) throw ResponseStatusException(HttpStatus.UNAUTHORIZED) series.books.minBy { it.metadata.numberSort }?.let { firstBook -> - bookController.getBookThumbnail(principal, request, firstBook.id) + bookController.getBookThumbnail(principal, firstBook.id) } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND) } ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)