diff --git a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/BrowseBenchmark.kt b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/BrowseBenchmark.kt index 6b2ede2f8..37446d4e7 100644 --- a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/BrowseBenchmark.kt +++ b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/BrowseBenchmark.kt @@ -25,7 +25,7 @@ class BrowseBenchmark : AbstractRestBenchmark() { // find series with most books biggestSeriesId = seriesController - .getAllSeries(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("booksCount")))) + .getSeriesDeprecated(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("booksCount")))) .content .first() .id @@ -33,11 +33,11 @@ class BrowseBenchmark : AbstractRestBenchmark() { @Benchmark fun browseSeries() { - seriesController.getAllSeries(principal, page = PageRequest.of(0, pageSize, Sort.by(Sort.Order.asc("metadata.titleSort")))) + seriesController.getSeriesDeprecated(principal, page = PageRequest.of(0, pageSize, Sort.by(Sort.Order.asc("metadata.titleSort")))) } @Benchmark fun browseSeriesBooks() { - seriesController.getAllBooksBySeries(principal, biggestSeriesId, page = PageRequest.of(0, pageSize, Sort.by(Sort.Order.asc("metadata.numberSort")))) + seriesController.getBooksBySeriesId(principal, biggestSeriesId, page = PageRequest.of(0, pageSize, Sort.by(Sort.Order.asc("metadata.numberSort")))) } } diff --git a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/DashboardBenchmark.kt b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/DashboardBenchmark.kt index c37296f26..ec93b958f 100644 --- a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/DashboardBenchmark.kt +++ b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/DashboardBenchmark.kt @@ -28,10 +28,10 @@ class DashboardBenchmark : AbstractRestBenchmark() { super.prepareData() // mark some books in progress - bookController.getAllBooks(principal, readStatus = listOf(ReadStatus.IN_PROGRESS), page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).let { page -> + bookController.getAllBooksDeprecated(principal, readStatus = listOf(ReadStatus.IN_PROGRESS), page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).let { page -> if (page.totalElements < DEFAULT_PAGE_SIZE) { - bookController.getAllBooks(principal, readStatus = listOf(ReadStatus.UNREAD), page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).content.forEach { book -> - bookController.markReadProgress(book.id, ReadProgressUpdateDto(2, false), principal) + bookController.getAllBooksDeprecated(principal, readStatus = listOf(ReadStatus.UNREAD), page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).content.forEach { book -> + bookController.markBookReadProgress(book.id, ReadProgressUpdateDto(2, false), principal) } } } @@ -39,16 +39,16 @@ class DashboardBenchmark : AbstractRestBenchmark() { // mark some books read for on deck bookController.getBooksOnDeck(principal, page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).let { page -> if (page.totalElements < DEFAULT_PAGE_SIZE) { - seriesController.getAllSeries(principal, readStatus = listOf(ReadStatus.UNREAD), oneshot = false, page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).content.forEach { series -> - val book = seriesController.getAllBooksBySeries(principal, series.id, page = Pageable.ofSize(1)).content.first() - bookController.markReadProgress(book.id, ReadProgressUpdateDto(null, true), principal) + seriesController.getSeriesDeprecated(principal, readStatus = listOf(ReadStatus.UNREAD), oneshot = false, page = Pageable.ofSize(DEFAULT_PAGE_SIZE)).content.forEach { series -> + val book = seriesController.getBooksBySeriesId(principal, series.id, page = Pageable.ofSize(1)).content.first() + bookController.markBookReadProgress(book.id, ReadProgressUpdateDto(null, true), principal) } } } // retrieve most recent book release date bookLatestReleaseDate = bookController - .getAllBooks(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("metadata.releaseDate")))) + .getAllBooksDeprecated(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("metadata.releaseDate")))) .content .firstOrNull() ?.metadata @@ -73,7 +73,7 @@ class DashboardBenchmark : AbstractRestBenchmark() { @Benchmark fun getBooksInProgress() { - bookController.getAllBooks(principal, readStatus = listOf(ReadStatus.IN_PROGRESS), page = pageableBooksInProgress) + bookController.getAllBooksDeprecated(principal, readStatus = listOf(ReadStatus.IN_PROGRESS), page = pageableBooksInProgress) } val pageableBooksOnDeck = Pageable.ofSize(DEFAULT_PAGE_SIZE) @@ -87,34 +87,34 @@ class DashboardBenchmark : AbstractRestBenchmark() { @Benchmark fun getBooksLatest() { - bookController.getAllBooks(principal, page = pageableBooksLatest) + bookController.getAllBooksDeprecated(principal, page = pageableBooksLatest) } val pageableBooksRecentlyReleased = PageRequest.of(0, DEFAULT_PAGE_SIZE, Sort.by(Sort.Order.desc("metadata.releaseDate"))) @Benchmark fun getBooksRecentlyReleased() { - bookController.getAllBooks(principal, releasedAfter = bookLatestReleaseDate.minusMonths(1), page = pageableBooksRecentlyReleased) + bookController.getAllBooksDeprecated(principal, releasedAfter = bookLatestReleaseDate.minusMonths(1), page = pageableBooksRecentlyReleased) } val pageableSeriesNew = Pageable.ofSize(DEFAULT_PAGE_SIZE) @Benchmark fun getSeriesNew() { - seriesController.getNewSeries(principal, page = pageableSeriesNew) + seriesController.getSeriesNew(principal, page = pageableSeriesNew) } val pageableSeriesUpdated = Pageable.ofSize(DEFAULT_PAGE_SIZE) @Benchmark fun getSeriesUpdated() { - seriesController.getUpdatedSeries(principal, page = pageableSeriesUpdated) + seriesController.getSeriesUpdated(principal, page = pageableSeriesUpdated) } val pageableBooksToCheck = Pageable.ofSize(1) @Benchmark fun getBooksToCheck() { - bookController.getAllBooks(principal, mediaStatus = listOf(Media.Status.ERROR, Media.Status.UNSUPPORTED), page = pageableBooksToCheck) + bookController.getAllBooksDeprecated(principal, mediaStatus = listOf(Media.Status.ERROR, Media.Status.UNSUPPORTED), page = pageableBooksToCheck) } } diff --git a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/UnsortedBenchmark.kt b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/UnsortedBenchmark.kt index 400a7a5f2..f93dcb3fd 100644 --- a/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/UnsortedBenchmark.kt +++ b/komga/src/benchmark/kotlin/org/gotson/komga/benchmark/rest/UnsortedBenchmark.kt @@ -24,7 +24,7 @@ class UnsortedBenchmark : AbstractRestBenchmark() { // find series with most books biggestSeriesId = seriesController - .getAllSeries(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("booksCount")))) + .getSeriesDeprecated(principal, page = PageRequest.of(0, 1, Sort.by(Sort.Order.desc("booksCount")))) .content .first() .id @@ -32,11 +32,11 @@ class UnsortedBenchmark : AbstractRestBenchmark() { @Benchmark fun getAllSeries() { - seriesController.getAllSeries(principal, page = Pageable.ofSize(pageSize)) + seriesController.getSeriesDeprecated(principal, page = Pageable.ofSize(pageSize)) } @Benchmark fun getAllBooks() { - bookController.getAllBooks(principal, page = Pageable.ofSize(pageSize)) + bookController.getAllBooksDeprecated(principal, page = Pageable.ofSize(pageSize)) } } diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/CommonBookController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/CommonBookController.kt index 86b108938..6261fd34e 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/CommonBookController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/CommonBookController.kt @@ -201,7 +201,7 @@ class CommonBookController( produces = [MediaType.ALL_VALUE], ) @PreAuthorize("hasRole('PAGE_STREAMING')") - fun getBookPageRaw( + fun getBookPageRawByNumber( @AuthenticationPrincipal principal: KomgaPrincipal, request: ServletWebRequest, @PathVariable bookId: String, @@ -264,7 +264,7 @@ class CommonBookController( ], produces = ["*/*"], ) - fun getBookResource( + fun getBookEpubResource( request: HttpServletRequest, @AuthenticationPrincipal principal: KomgaPrincipal?, @PathVariable bookId: String, @@ -323,7 +323,7 @@ class CommonBookController( produces = [MediaType.APPLICATION_OCTET_STREAM_VALUE], ) @PreAuthorize("hasRole('FILE_DOWNLOAD')") - fun getBookFile( + fun downloadBookFile( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): ResponseEntity = getBookFileInternal(principal, bookId) @@ -373,7 +373,7 @@ class CommonBookController( ], produces = [MEDIATYPE_PROGRESSION_JSON_VALUE], ) - fun getProgression( + fun getBookProgression( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): ResponseEntity = @@ -393,7 +393,7 @@ class CommonBookController( ], ) @ResponseStatus(HttpStatus.NO_CONTENT) - fun markProgression( + fun updateBookProgression( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, @RequestBody progression: R2Progression, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/BookController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/BookController.kt index 6160d00e6..e81a2dded 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/BookController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/BookController.kt @@ -120,7 +120,7 @@ class BookController( @PageableAsQueryParam @GetMapping("api/v1/books") @Operation(summary = "List books", description = "Use POST /api/v1/books/list instead. Deprecated since 1.19.0.", tags = [OpenApiConfiguration.TagNames.BOOKS, OpenApiConfiguration.TagNames.DEPRECATED]) - fun getAllBooks( + fun getAllBooksDeprecated( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", required = false) searchTerm: String? = null, @RequestParam(name = "library_id", required = false) libraryIds: List? = null, @@ -172,7 +172,7 @@ class BookController( @PageableAsQueryParam @PostMapping("api/v1/books/list") @Operation(summary = "List books", tags = [OpenApiConfiguration.TagNames.BOOKS]) - fun getBooksList( + fun getBooks( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestBody search: BookSearch, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @@ -203,7 +203,7 @@ class BookController( @Operation(summary = "List latest books", description = "Return newly added or updated books.", tags = [OpenApiConfiguration.TagNames.BOOKS]) @PageableWithoutSortAsQueryParam @GetMapping("api/v1/books/latest") - fun getLatestBooks( + fun getBooksLatest( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @Parameter(hidden = true) page: Pageable, @@ -247,7 +247,7 @@ class BookController( @PageableAsQueryParam @GetMapping("api/v1/books/duplicates") @PreAuthorize("hasRole('ADMIN')") - fun getDuplicateBooks( + fun getBooksDuplicates( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @Parameter(hidden = true) page: Pageable, @@ -273,7 +273,7 @@ class BookController( @Operation(summary = "Get book details", tags = [OpenApiConfiguration.TagNames.BOOKS]) @GetMapping("api/v1/books/{bookId}") - fun getOneBook( + fun getBookById( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): BookDto = @@ -313,7 +313,7 @@ class BookController( @Operation(summary = "List book's readlists", tags = [OpenApiConfiguration.TagNames.BOOKS]) @GetMapping("api/v1/books/{bookId}/readlists") - fun getAllReadListsByBook( + fun getReadListsByBookId( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "bookId") bookId: String, ): List { @@ -400,7 +400,7 @@ class BookController( @PutMapping("api/v1/books/{bookId}/thumbnails/{thumbnailId}/selected") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun markSelectedBookThumbnail( + fun markBookThumbnailSelected( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "bookId") bookId: String, @PathVariable(name = "thumbnailId") thumbnailId: String, @@ -471,7 +471,7 @@ class BookController( produces = [MediaType.ALL_VALUE], ) @PreAuthorize("hasRole('PAGE_STREAMING')") - fun getBookPage( + fun getBookPageByNumber( @AuthenticationPrincipal principal: KomgaPrincipal, request: ServletWebRequest, @PathVariable bookId: String, @@ -498,7 +498,7 @@ class BookController( value = ["api/v1/books/{bookId}/pages/{pageNumber}/thumbnail"], produces = [MediaType.IMAGE_JPEG_VALUE], ) - fun getBookPageThumbnail( + fun getBookPageThumbnailByNumber( @AuthenticationPrincipal principal: KomgaPrincipal, request: WebRequest, @PathVariable bookId: String, @@ -540,7 +540,7 @@ class BookController( value = ["api/v1/books/{bookId}/manifest"], produces = [MEDIATYPE_WEBPUB_JSON_VALUE, MEDIATYPE_DIVINA_JSON_VALUE], ) - fun getWebPubManifest( + fun getBookWebPubManifest( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): ResponseEntity { @@ -556,7 +556,7 @@ class BookController( value = ["api/v1/books/{bookId}/positions"], produces = [MEDIATYPE_POSITION_LIST_JSON_VALUE], ) - fun getPositions( + fun getBookPositions( request: HttpServletRequest, @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, @@ -589,7 +589,7 @@ class BookController( value = ["api/v1/books/{bookId}/manifest/epub"], produces = [MEDIATYPE_WEBPUB_JSON_VALUE], ) - fun getWebPubManifestEpub( + fun getBookWebPubManifestEpub( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): WPPublicationDto = commonBookController.getWebPubManifestEpubInternal(principal, bookId, webPubGenerator) @@ -599,7 +599,7 @@ class BookController( value = ["api/v1/books/{bookId}/manifest/pdf"], produces = [MEDIATYPE_WEBPUB_JSON_VALUE], ) - fun getWebPubManifestPdf( + fun getBookWebPubManifestPdf( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): WPPublicationDto = commonBookController.getWebPubManifestPdfInternal(principal, bookId, webPubGenerator) @@ -609,7 +609,7 @@ class BookController( value = ["api/v1/books/{bookId}/manifest/divina"], produces = [MEDIATYPE_DIVINA_JSON_VALUE], ) - fun getWebPubManifestDivina( + fun getBookWebPubManifestDivina( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable bookId: String, ): WPPublicationDto = commonBookController.getWebPubManifestDivinaInternal(principal, bookId, webPubGenerator) @@ -618,7 +618,7 @@ class BookController( @PostMapping("api/v1/books/{bookId}/analyze") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun analyze( + fun bookAnalyze( @PathVariable bookId: String, ) { bookRepository.findByIdOrNull(bookId)?.let { book -> @@ -630,7 +630,7 @@ class BookController( @PostMapping("api/v1/books/{bookId}/metadata/refresh") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun refreshMetadata( + fun bookRefreshMetadata( @PathVariable bookId: String, ) { bookRepository.findByIdOrNull(bookId)?.let { book -> @@ -643,7 +643,7 @@ class BookController( @PatchMapping("api/v1/books/{bookId}/metadata") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun updateMetadata( + fun updateBookMetadata( @PathVariable bookId: String, @Parameter(description = "Metadata fields to update. Set a field to null to unset the metadata. You can omit fields you don't want to update.") @Valid @@ -663,7 +663,7 @@ class BookController( @PatchMapping("api/v1/books/metadata") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun updateBatchMetadata( + fun updateBookMetadataByBatch( @Parameter(description = "A map of book IDs which values are the metadata fields to update. Set a field to null to unset the metadata. You can omit fields you don't want to update.") @Valid @RequestBody @@ -686,7 +686,7 @@ class BookController( @Operation(summary = "Mark book's read progress", description = "Mark book as read and/or change page progress.", tags = [OpenApiConfiguration.TagNames.BOOKS]) @PatchMapping("api/v1/books/{bookId}/read-progress") @ResponseStatus(HttpStatus.NO_CONTENT) - fun markReadProgress( + fun markBookReadProgress( @PathVariable bookId: String, @Parameter(description = "page can be omitted if completed is set to true. completed can be omitted, and will be set accordingly depending on the page passed and the total number of pages in the book.") @Valid @@ -711,7 +711,7 @@ class BookController( @Operation(summary = "Mark book as unread", description = "Mark book as unread", tags = [OpenApiConfiguration.TagNames.BOOKS]) @DeleteMapping("api/v1/books/{bookId}/read-progress") @ResponseStatus(HttpStatus.NO_CONTENT) - fun deleteReadProgress( + fun deleteBookReadProgress( @PathVariable bookId: String, @AuthenticationPrincipal principal: KomgaPrincipal, ) { @@ -762,7 +762,7 @@ class BookController( @PutMapping("api/v1/books/thumbnails") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun regenerateThumbnails( + fun booksRegenerateThumbnails( @RequestParam(name = "for_bigger_result_only", required = false) forBiggerResultOnly: Boolean = false, ) { taskEmitter.findBookThumbnailsToRegenerate(forBiggerResultOnly, LOWEST_PRIORITY) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClaimController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClaimController.kt index 0b41e988f..0a8ec0f03 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClaimController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClaimController.kt @@ -35,7 +35,7 @@ class ClaimController( @PostMapping @Operation(summary = "Claim server", description = "Creates an admin user with the provided credentials.") - fun claimAdmin( + fun claimServer( @Email(regexp = ".+@.+\\..+") @RequestHeader("X-Komga-Email") email: String, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClientSettingsController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClientSettingsController.kt index 121fbc4f7..bc9116643 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClientSettingsController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ClientSettingsController.kt @@ -142,7 +142,7 @@ class ClientSettingsController( ), ], ) - fun deleteGlobalSetting( + fun deleteGlobalSettings( @RequestBody keysToDelete: Set< @Pattern(regexp = KEY_REGEX) String, @@ -164,7 +164,7 @@ class ClientSettingsController( ), ], ) - fun deleteGlobalSetting( + fun deleteUserSettings( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestBody keysToDelete: Set< @Pattern(regexp = KEY_REGEX) diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/FontsController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/FontsController.kt index 00e704897..ce97c11ad 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/FontsController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/FontsController.kt @@ -88,7 +88,7 @@ class FontsController( @GetMapping("families") @Operation(summary = "List font families", description = "List all available font families.") - fun listFonts(): Set = fonts.keys + fun getFonts(): Set = fonts.keys @GetMapping("resource/{fontFamily}/{fontFile}") @Operation(summary = "Download font file") diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/HistoricalEventController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/HistoricalEventController.kt index b348bffb7..69179edd0 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/HistoricalEventController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/HistoricalEventController.kt @@ -27,7 +27,7 @@ class HistoricalEventController( @GetMapping @PageableAsQueryParam @Operation(summary = "List historical events") - fun getAll( + fun getHistoricalEvents( @Parameter(hidden = true) page: Pageable, ): Page { val sort = diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt index d5978b41f..be3eb3b89 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LibraryController.kt @@ -60,7 +60,7 @@ class LibraryController( summary = "List all libraries", description = "The libraries are filtered based on the current user's permissions", ) - fun getAll( + fun getLibraries( @AuthenticationPrincipal principal: KomgaPrincipal, ): List = if (principal.user.canAccessAllLibraries()) { @@ -71,7 +71,7 @@ class LibraryController( @GetMapping("{libraryId}") @Operation(summary = "Get details for a single library") - fun getOne( + fun getLibraryById( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable libraryId: String, ): LibraryDto = @@ -83,7 +83,7 @@ class LibraryController( @PostMapping @PreAuthorize("hasRole('ADMIN')") @Operation(summary = "Create a library") - fun addOne( + fun addLibrary( @AuthenticationPrincipal principal: KomgaPrincipal, @Valid @RequestBody library: LibraryCreationDto, @@ -140,19 +140,19 @@ class LibraryController( @ResponseStatus(HttpStatus.NO_CONTENT) @Deprecated("Use PATCH /v1/libraries/{libraryId} instead", ReplaceWith("patchOne")) @Operation(summary = "Update a library", description = "Use PATCH /api/v1/libraries/{libraryId} instead. Deprecated since 1.3.0.", tags = [OpenApiConfiguration.TagNames.DEPRECATED]) - fun updateOne( + fun updateLibraryByIdDeprecated( @PathVariable libraryId: String, @Valid @RequestBody library: LibraryUpdateDto, ) { - patchOne(libraryId, library) + updateLibraryById(libraryId, library) } @PatchMapping("/{libraryId}") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) @Operation(summary = "Update a library", description = "You can omit fields you don't want to update") - fun patchOne( + fun updateLibraryById( @PathVariable libraryId: String, @Parameter(description = "Fields to update. You can omit fields you don't want to update.") @Valid @@ -215,7 +215,7 @@ class LibraryController( @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) @Operation(summary = "Delete a library") - fun deleteOne( + fun deleteLibraryById( @PathVariable libraryId: String, ) { libraryRepository.findByIdOrNull(libraryId)?.let { @@ -227,7 +227,7 @@ class LibraryController( @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) @Operation(summary = "Scan a library") - fun scan( + fun libraryScan( @PathVariable libraryId: String, @RequestParam(required = false) deep: Boolean = false, ) { @@ -240,7 +240,7 @@ class LibraryController( @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) @Operation(summary = "Analyze a library") - fun analyze( + fun libraryAnalyze( @PathVariable libraryId: String, ) { val books = @@ -257,7 +257,7 @@ class LibraryController( @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) @Operation(summary = "Refresh metadata for a library") - fun refreshMetadata( + fun libraryRefreshMetadata( @PathVariable libraryId: String, ) { val books = @@ -276,7 +276,7 @@ class LibraryController( @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) @Operation(summary = "Empty trash for a library") - fun emptyTrash( + fun libraryEmptyTrash( @PathVariable libraryId: String, ) { libraryRepository.findByIdOrNull(libraryId)?.let { library -> diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LoginController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LoginController.kt index 59274dbc2..ef96f9543 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LoginController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/LoginController.kt @@ -23,7 +23,7 @@ class LoginController( @Operation(summary = "Set cookie", description = "Forcefully return Set-Cookie header, even if the session is contained in the X-Auth-Token header.") @GetMapping("api/v1/login/set-cookie") @ResponseStatus(HttpStatus.NO_CONTENT) - fun headerToCookie( + fun convertHeaderSessionToCookie( request: HttpServletRequest, response: HttpServletResponse, session: HttpSession, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/OAuth2Controller.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/OAuth2Controller.kt index 72b60290c..abbae560d 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/OAuth2Controller.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/OAuth2Controller.kt @@ -24,7 +24,7 @@ class OAuth2Controller( @GetMapping("providers") @Operation(summary = "List registered OAuth2 providers") - fun getProviders() = registrationIds + fun getOAuth2Providers() = registrationIds } data class OAuth2ClientDto( diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/PageHashController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/PageHashController.kt index 684896a18..601fc5823 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/PageHashController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/PageHashController.kt @@ -120,7 +120,7 @@ class PageHashController( @Operation(summary = "Delete all duplicate pages by hash") @PostMapping("{pageHash}/delete-all") @ResponseStatus(HttpStatus.ACCEPTED) - fun performDelete( + fun deleteDuplicatePagesByPageHash( @PathVariable pageHash: String, ) { val toRemove = @@ -145,7 +145,7 @@ class PageHashController( @Operation(summary = "Delete specific duplicate page") @PostMapping("{pageHash}/delete-match") @ResponseStatus(HttpStatus.ACCEPTED) - fun deleteSingleMatch( + fun deleteSingleMatchByPageHash( @PathVariable pageHash: String, @RequestBody matchDto: PageHashMatchDto, ) { diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt index ea1e4a1ad..f2d3347b6 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReadListController.kt @@ -103,7 +103,7 @@ class ReadListController( @Operation(summary = "List readlists", tags = [OpenApiConfiguration.TagNames.READLISTS]) @PageableWithoutSortAsQueryParam @GetMapping - fun getAll( + fun getReadLists( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", required = false) searchTerm: String?, @RequestParam(name = "library_id", required = false) libraryIds: List?, @@ -134,7 +134,7 @@ class ReadListController( @Operation(summary = "Get readlist details", tags = [OpenApiConfiguration.TagNames.READLISTS]) @GetMapping("{id}") - fun getOne( + fun getReadListById( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable id: String, ): ReadListDto = @@ -217,7 +217,7 @@ class ReadListController( @PutMapping("{id}/thumbnails/{thumbnailId}/selected") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun markSelectedReadListThumbnail( + fun markReadListThumbnailSelected( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "id") id: String, @PathVariable(name = "thumbnailId") thumbnailId: String, @@ -249,7 +249,7 @@ class ReadListController( @Operation(summary = "Create readlist", tags = [OpenApiConfiguration.TagNames.READLISTS]) @PostMapping @PreAuthorize("hasRole('ADMIN')") - fun addOne( + fun createReadList( @Valid @RequestBody readList: ReadListCreationDto, ): ReadListDto = @@ -270,7 +270,7 @@ class ReadListController( @Operation(summary = "Match ComicRack list", tags = [OpenApiConfiguration.TagNames.COMICRACK]) @PostMapping("match/comicrack") @PreAuthorize("hasRole('ADMIN')") - fun matchFromComicRackList( + fun matchComicRackList( @RequestParam("file") file: MultipartFile, ): ReadListRequestMatchDto = try { @@ -283,7 +283,7 @@ class ReadListController( @PatchMapping("{id}") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun updateOne( + fun updateReadListById( @PathVariable id: String, @Valid @RequestBody readList: ReadListUpdateDto, @@ -308,7 +308,7 @@ class ReadListController( @DeleteMapping("{id}") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun deleteOne( + fun deleteReadListById( @PathVariable id: String, ) { readListRepository.findByIdOrNull(id)?.let { @@ -320,7 +320,7 @@ class ReadListController( @PageableWithoutSortAsQueryParam @AuthorsAsQueryParam @GetMapping("{id}/books") - fun getBooksForReadList( + fun getBooksByReadListId( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "library_id", required = false) libraryIds: List?, @@ -370,7 +370,7 @@ class ReadListController( @Operation(summary = "Get previous book in readlist", tags = [OpenApiConfiguration.TagNames.READLIST_BOOKS]) @GetMapping("{id}/books/{bookId}/previous") - fun getBookSiblingPrevious( + fun getBookSiblingPreviousInReadList( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable id: String, @PathVariable bookId: String, @@ -388,7 +388,7 @@ class ReadListController( @Operation(summary = "Get next book in readlist", tags = [OpenApiConfiguration.TagNames.READLIST_BOOKS]) @GetMapping("{id}/books/{bookId}/next") - fun getBookSiblingNext( + fun getBookSiblingNextInReadList( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable id: String, @PathVariable bookId: String, @@ -406,7 +406,7 @@ class ReadListController( @Operation(summary = "Get readlist read progress (Mihon)", description = "Mihon specific, due to how read progress is handled in Mihon.", tags = [OpenApiConfiguration.TagNames.MIHON]) @GetMapping("{id}/read-progress/tachiyomi") - fun getReadProgress( + fun getMihonReadProgressByReadListId( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, ): TachiyomiReadProgressDto = @@ -417,7 +417,7 @@ class ReadListController( @Operation(summary = "Update readlist read progress (Mihon)", description = "Mihon specific, due to how read progress is handled in Mihon.", tags = [OpenApiConfiguration.TagNames.MIHON]) @PutMapping("{id}/read-progress/tachiyomi") @ResponseStatus(HttpStatus.NO_CONTENT) - fun markReadProgressTachiyomi( + fun updateMihonReadProgressByReadListId( @PathVariable id: String, @Valid @RequestBody readProgress: TachiyomiReadProgressUpdateDto, @@ -437,7 +437,7 @@ class ReadListController( @Operation(summary = "Download readlist", description = "Download the whole readlist as a ZIP file.", tags = [OpenApiConfiguration.TagNames.READLISTS]) @GetMapping("{id}/file", produces = [MediaType.APPLICATION_OCTET_STREAM_VALUE]) @PreAuthorize("hasRole('FILE_DOWNLOAD')") - fun getReadListFile( + fun downloadReadListAsZip( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable id: String, ): ResponseEntity { diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReferentialController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReferentialController.kt index 27547a35e..f0c3cb99e 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReferentialController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/ReferentialController.kt @@ -28,7 +28,7 @@ class ReferentialController( @GetMapping("v1/authors") @Deprecated("Use GET /v2/authors instead", ReplaceWith("getAuthors")) @Operation(summary = "List authors", description = "Use GET /api/v2/authors instead. Deprecated since 1.20.0.", tags = [OpenApiConfiguration.TagNames.DEPRECATED]) - fun getAuthorsV1( + fun getAuthorsDeprecated( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", defaultValue = "") search: String, @RequestParam(name = "library_id", required = false) libraryId: String?, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionController.kt index 080b6eb6b..93ab63f23 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesCollectionController.kt @@ -82,7 +82,7 @@ class SeriesCollectionController( @Operation(summary = "List collections", tags = [OpenApiConfiguration.TagNames.COLLECTIONS]) @PageableWithoutSortAsQueryParam @GetMapping - fun getAll( + fun getCollections( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", required = false) searchTerm: String?, @RequestParam(name = "library_id", required = false) libraryIds: List?, @@ -112,7 +112,7 @@ class SeriesCollectionController( @Operation(summary = "Get collection details", tags = [OpenApiConfiguration.TagNames.COLLECTIONS]) @GetMapping("{id}") - fun getOne( + fun getCollectionById( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable id: String, ): CollectionDto = @@ -195,7 +195,7 @@ class SeriesCollectionController( @PutMapping("{id}/thumbnails/{thumbnailId}/selected") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun markSelectedCollectionThumbnail( + fun markCollectionThumbnailSelected( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "id") id: String, @PathVariable(name = "thumbnailId") thumbnailId: String, @@ -227,7 +227,7 @@ class SeriesCollectionController( @Operation(summary = "Create collection", tags = [OpenApiConfiguration.TagNames.COLLECTIONS]) @PostMapping @PreAuthorize("hasRole('ADMIN')") - fun addOne( + fun createCollection( @Valid @RequestBody collection: CollectionCreationDto, ): CollectionDto = @@ -248,7 +248,7 @@ class SeriesCollectionController( @PatchMapping("{id}") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun updateOne( + fun updateCollectionById( @PathVariable id: String, @Valid @RequestBody collection: CollectionUpdateDto, @@ -272,7 +272,7 @@ class SeriesCollectionController( @DeleteMapping("{id}") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun deleteOne( + fun deleteCollectionById( @PathVariable id: String, ) { collectionRepository.findByIdOrNull(id)?.let { @@ -284,7 +284,7 @@ class SeriesCollectionController( @PageableWithoutSortAsQueryParam @AuthorsAsQueryParam @GetMapping("{id}/series") - fun getSeriesForCollection( + fun getSeriesByCollectionId( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "library_id", required = false) libraryIds: List?, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesController.kt index 918b356c9..114a3d688 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SeriesController.kt @@ -133,7 +133,7 @@ class SeriesController( ), ) @GetMapping("v1/series") - fun getAllSeries( + fun getSeriesDeprecated( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", required = false) searchTerm: String? = null, @Parameter(hidden = true) @@ -226,7 +226,7 @@ class SeriesController( @Operation(summary = "List series", tags = [OpenApiConfiguration.TagNames.SERIES]) @PageableAsQueryParam @PostMapping("v1/series/list") - fun getSeriesList( + fun getSeries( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestBody search: SeriesSearch, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @@ -266,7 +266,7 @@ class SeriesController( ), ) @GetMapping("v1/series/alphabetical-groups") - fun getAlphabeticalGroups( + fun getSeriesAlphabeticalGroupsDeprecated( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "search", required = false) searchTerm: String?, @Parameter(hidden = true) @@ -338,7 +338,7 @@ class SeriesController( @Operation(summary = "List series groups", description = "List series grouped by the first character of their sort title.", tags = [OpenApiConfiguration.TagNames.SERIES]) @PostMapping("v1/series/list/alphabetical-groups") - fun getSeriesListByAlphabeticalGroups( + fun getSeriesAlphabeticalGroups( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestBody search: SeriesSearch, ): List = seriesDtoRepository.countByFirstCharacter(search, SearchContext(principal.user)) @@ -346,7 +346,7 @@ class SeriesController( @Operation(summary = "List latest series", description = "Return recently added or updated series.", tags = [OpenApiConfiguration.TagNames.SERIES]) @PageableWithoutSortAsQueryParam @GetMapping("v1/series/latest") - fun getLatestSeries( + fun getSeriesLatest( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "library_id", required = false) libraryIds: List?, @RequestParam(name = "deleted", required = false) deleted: Boolean?, @@ -385,7 +385,7 @@ class SeriesController( @Operation(summary = "List new series", description = "Return newly added series.", tags = [OpenApiConfiguration.TagNames.SERIES]) @PageableWithoutSortAsQueryParam @GetMapping("v1/series/new") - fun getNewSeries( + fun getSeriesNew( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "library_id", required = false) libraryIds: List? = null, @RequestParam(name = "deleted", required = false) deleted: Boolean? = null, @@ -424,7 +424,7 @@ class SeriesController( @Operation(summary = "List updated series", description = "Return recently updated series, but not newly added ones.", tags = [OpenApiConfiguration.TagNames.SERIES]) @PageableWithoutSortAsQueryParam @GetMapping("v1/series/updated") - fun getUpdatedSeries( + fun getSeriesUpdated( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "library_id", required = false) libraryIds: List? = null, @RequestParam(name = "deleted", required = false) deleted: Boolean? = null, @@ -462,7 +462,7 @@ class SeriesController( @Operation(summary = "Get series details", tags = [OpenApiConfiguration.TagNames.SERIES]) @GetMapping("v1/series/{seriesId}") - fun getOneSeries( + fun getSeriesById( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "seriesId") id: String, ): SeriesDto = @@ -474,7 +474,7 @@ class SeriesController( @Operation(summary = "Get series' poster image", tags = [OpenApiConfiguration.TagNames.SERIES_POSTER]) @ApiResponse(content = [Content(schema = Schema(type = "string", format = "binary"))]) @GetMapping(value = ["v1/series/{seriesId}/thumbnail"], produces = [MediaType.IMAGE_JPEG_VALUE]) - fun getSeriesDefaultThumbnail( + fun getSeriesThumbnail( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "seriesId") seriesId: String, ): ByteArray { @@ -514,7 +514,7 @@ class SeriesController( @Operation(summary = "Add series poster", tags = [OpenApiConfiguration.TagNames.SERIES_POSTER]) @PostMapping(value = ["v1/series/{seriesId}/thumbnails"], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE]) @PreAuthorize("hasRole('ADMIN')") - fun postUserUploadedSeriesThumbnail( + fun addUserUploadedSeriesThumbnail( @PathVariable(name = "seriesId") seriesId: String, @RequestParam("file") file: MultipartFile, @RequestParam("selected") selected: Boolean = true, @@ -544,7 +544,7 @@ class SeriesController( @PutMapping("v1/series/{seriesId}/thumbnails/{thumbnailId}/selected") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun postMarkSelectedSeriesThumbnail( + fun markSeriesThumbnailSelected( @PathVariable(name = "seriesId") seriesId: String, @PathVariable(name = "thumbnailId") thumbnailId: String, ) { @@ -578,7 +578,7 @@ class SeriesController( @PageableAsQueryParam @AuthorsAsQueryParam @GetMapping("v1/series/{seriesId}/books") - fun getAllBooksBySeries( + fun getBooksBySeriesId( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "seriesId") seriesId: String, @RequestParam(name = "media_status", required = false) mediaStatus: List? = null, @@ -630,7 +630,7 @@ class SeriesController( @Operation(summary = "List series' collections", tags = [OpenApiConfiguration.TagNames.SERIES]) @GetMapping("v1/series/{seriesId}/collections") - fun getAllCollectionsBySeries( + fun getCollectionsBySeriesId( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable(name = "seriesId") seriesId: String, ): List { @@ -645,7 +645,7 @@ class SeriesController( @PostMapping("v1/series/{seriesId}/analyze") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun analyze( + fun seriesAnalyze( @PathVariable seriesId: String, ) { taskEmitter.analyzeBook(bookRepository.findAllBySeriesId(seriesId), HIGH_PRIORITY) @@ -655,7 +655,7 @@ class SeriesController( @PostMapping("v1/series/{seriesId}/metadata/refresh") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun refreshMetadata( + fun seriesRefreshMetadata( @PathVariable seriesId: String, ) { val books = bookRepository.findAllBySeriesId(seriesId) @@ -668,7 +668,7 @@ class SeriesController( @PatchMapping("v1/series/{seriesId}/metadata") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.NO_CONTENT) - fun updateMetadata( + fun updateSeriesMetadata( @PathVariable seriesId: String, @Parameter(description = "Metadata fields to update. Set a field to null to unset the metadata. You can omit fields you don't want to update.") @Valid @@ -742,7 +742,7 @@ class SeriesController( @Operation(summary = "Mark series as read", description = "Mark all book for series as read", tags = [OpenApiConfiguration.TagNames.SERIES]) @PostMapping("v1/series/{seriesId}/read-progress") @ResponseStatus(HttpStatus.NO_CONTENT) - fun markAsRead( + fun markSeriesAsRead( @PathVariable seriesId: String, @AuthenticationPrincipal principal: KomgaPrincipal, ) { @@ -754,7 +754,7 @@ class SeriesController( @Operation(summary = "Mark series as unread", description = "Mark all book for series as unread", tags = [OpenApiConfiguration.TagNames.SERIES]) @DeleteMapping("v1/series/{seriesId}/read-progress") @ResponseStatus(HttpStatus.NO_CONTENT) - fun markAsUnread( + fun markSeriesAsUnread( @PathVariable seriesId: String, @AuthenticationPrincipal principal: KomgaPrincipal, ) { @@ -765,7 +765,7 @@ class SeriesController( @Operation(summary = "Get series read progress (Mihon)", description = "Mihon specific, due to how read progress is handled in Mihon.", tags = [OpenApiConfiguration.TagNames.MIHON]) @GetMapping("v2/series/{seriesId}/read-progress/tachiyomi") - fun getReadProgressTachiyomiV2( + fun getMihonReadProgressBySeriesId( @PathVariable seriesId: String, @AuthenticationPrincipal principal: KomgaPrincipal, ): TachiyomiReadProgressV2Dto { @@ -777,7 +777,7 @@ class SeriesController( @Operation(summary = "Update series read progress (Mihon)", description = "Mihon specific, due to how read progress is handled in Mihon.", tags = [OpenApiConfiguration.TagNames.MIHON]) @PutMapping("v2/series/{seriesId}/read-progress/tachiyomi") @ResponseStatus(HttpStatus.NO_CONTENT) - fun markReadProgressTachiyomiV2( + fun updateMihonReadProgressBySeriesId( @PathVariable seriesId: String, @RequestBody readProgress: TachiyomiReadProgressUpdateV2Dto, @AuthenticationPrincipal principal: KomgaPrincipal, @@ -800,7 +800,7 @@ class SeriesController( @Operation(summary = "Download series", description = "Download the whole series as a ZIP file.", tags = [OpenApiConfiguration.TagNames.SERIES]) @GetMapping("v1/series/{seriesId}/file", produces = [MediaType.APPLICATION_OCTET_STREAM_VALUE]) @PreAuthorize("hasRole('FILE_DOWNLOAD')") - fun getSeriesFile( + fun downloadSeriesAsZip( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable seriesId: String, ): ResponseEntity { @@ -849,7 +849,7 @@ class SeriesController( @DeleteMapping("v1/series/{seriesId}/file") @PreAuthorize("hasRole('ADMIN')") @ResponseStatus(HttpStatus.ACCEPTED) - fun deleteSeries( + fun deleteSeriesFile( @PathVariable seriesId: String, ) { taskEmitter.deleteSeries( diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SettingsController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SettingsController.kt index 063d4dc41..878fb5c2b 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SettingsController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SettingsController.kt @@ -38,7 +38,7 @@ class SettingsController( ) { @GetMapping @Operation(summary = "Retrieve server settings") - fun getSettings(): SettingsDto = + fun getServerSettings(): SettingsDto = SettingsDto( komgaSettingsProvider.deleteEmptyCollections, komgaSettingsProvider.deleteEmptyReadLists, @@ -55,7 +55,7 @@ class SettingsController( @PatchMapping @ResponseStatus(HttpStatus.NO_CONTENT) @Operation(summary = "Update server settings", description = "You can omit fields you don't want to update") - fun updateSettings( + fun updateServerSettings( @Valid @RequestBody @Parameter(description = "Fields to update. You can omit fields you don't want to update.") newSettings: SettingsUpdateDto, diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SyncPointController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SyncPointController.kt index a7d1e24b8..0cef96ffe 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SyncPointController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/SyncPointController.kt @@ -26,7 +26,7 @@ class SyncPointController( summary = "Delete all sync points", description = "If an API Key ID is passed, deletes only the sync points associated with that API Key. Deleting sync points will allow a Kobo to sync from scratch upon the next sync.", ) - fun deleteMySyncPointsByApiKey( + fun deleteSyncPointsForCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(required = false, name = "key_id") keyIds: Collection?, ) { diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/TransientBooksController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/TransientBooksController.kt index fe7f1cb87..0322d8afc 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/TransientBooksController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/TransientBooksController.kt @@ -42,7 +42,7 @@ class TransientBooksController( ) { @PostMapping @Operation(summary = "Scan folder for transient books", description = "Scan provided folder for transient books.") - fun scanForTransientBooks( + fun scanTransientBooks( @RequestBody request: ScanRequestDto, ): List = try { @@ -56,7 +56,7 @@ class TransientBooksController( @PostMapping("{id}/analyze") @Operation(summary = "Analyze transient book") - fun analyze( + fun analyzeTransientBook( @PathVariable id: String, ): TransientBookDto = transientBookRepository.findByIdOrNull(id)?.let { @@ -68,7 +68,7 @@ class TransientBooksController( produces = [MediaType.ALL_VALUE], ) @Operation(summary = "Get transient book page") - fun getSourcePage( + fun getPageByTransientBookId( @PathVariable id: String, @PathVariable pageNumber: Int, ): ResponseEntity = diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/UserController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/UserController.kt index adb666f0f..a8341c7d6 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/UserController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/UserController.kt @@ -62,14 +62,14 @@ class UserController( @GetMapping("me") @Operation(summary = "Retrieve current user", tags = [TagNames.CURRENT_USER]) - fun getMe( + fun getCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, ): UserDto = principal.toDto() @PatchMapping("me/password") @ResponseStatus(HttpStatus.NO_CONTENT) @Operation(summary = "Update current user's password", tags = [TagNames.CURRENT_USER]) - fun updateMyPassword( + fun updatePasswordForCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, @Valid @RequestBody newPasswordDto: PasswordUpdateDto, @@ -83,13 +83,13 @@ class UserController( @GetMapping @PreAuthorize("hasRole('ADMIN')") @Operation(summary = "List users", tags = [TagNames.USERS]) - fun getAll(): List = userRepository.findAll().map { it.toDto() } + fun getUsers(): List = userRepository.findAll().map { it.toDto() } @PostMapping @ResponseStatus(HttpStatus.CREATED) @PreAuthorize("hasRole('ADMIN')") @Operation(summary = "Create user", tags = [TagNames.USERS]) - fun addOne( + fun addUser( @Valid @RequestBody newUser: UserCreationDto, ): UserDto = @@ -103,7 +103,7 @@ class UserController( @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ADMIN') and #principal.user.id != #id") @Operation(summary = "Delete user", tags = [TagNames.USERS]) - fun delete( + fun deleteUserById( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, ) { @@ -116,7 +116,7 @@ class UserController( @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ADMIN') and #principal.user.id != #id") @Operation(summary = "Update user", tags = [TagNames.USERS]) - fun updateUser( + fun updateUserById( @PathVariable id: String, @Valid @RequestBody patch: UserUpdateDto, @@ -171,7 +171,7 @@ class UserController( @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize("hasRole('ADMIN') or #principal.user.id == #id") @Operation(summary = "Update user's password", tags = [TagNames.USERS]) - fun updatePassword( + fun updatePasswordByUserId( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, @Valid @RequestBody @@ -186,7 +186,7 @@ class UserController( @GetMapping("me/authentication-activity") @PageableAsQueryParam @Operation(summary = "Retrieve authentication activity for the current user", tags = [TagNames.CURRENT_USER]) - fun getMyAuthenticationActivity( + fun getAuthenticationActivityForCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(name = "unpaged", required = false) unpaged: Boolean = false, @Parameter(hidden = true) page: Pageable, @@ -241,7 +241,7 @@ class UserController( @GetMapping("{id}/authentication-activity/latest") @PreAuthorize("hasRole('ADMIN') or #principal.user.id == #id") @Operation(summary = "Retrieve latest authentication activity for a user", tags = [TagNames.USERS]) - fun getLatestAuthenticationActivityForUser( + fun getLatestAuthenticationActivityByUserId( @PathVariable id: String, @AuthenticationPrincipal principal: KomgaPrincipal, @RequestParam(required = false, name = "apikey_id") apiKeyId: String?, @@ -253,7 +253,7 @@ class UserController( @GetMapping("me/api-keys") @Operation(summary = "Retrieve API keys", tags = [TagNames.API_KEYS]) - fun getApiKeys( + fun getApiKeysForCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, ): Collection { if (demo && !principal.user.isAdmin) throw ResponseStatusException(HttpStatus.FORBIDDEN) @@ -262,7 +262,7 @@ class UserController( @PostMapping("me/api-keys") @Operation(summary = "Create API key", tags = [TagNames.API_KEYS]) - fun createApiKey( + fun createApiKeyForCurrentUser( @AuthenticationPrincipal principal: KomgaPrincipal, @Valid @RequestBody apiKeyRequest: ApiKeyRequestDto, ): ApiKeyDto { @@ -278,7 +278,7 @@ class UserController( @DeleteMapping("me/api-keys/{keyId}") @ResponseStatus(HttpStatus.NO_CONTENT) @Operation(summary = "Delete API key", tags = [TagNames.API_KEYS]) - fun deleteApiKey( + fun deleteApiKeyByKeyId( @AuthenticationPrincipal principal: KomgaPrincipal, @PathVariable keyId: String, ) {