fix(metadata): ensure authors/genres are replaced, not merged, during metadata update by defaulting mergeCategories to false (#2304)

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
Balázs Szücs
2026-01-18 18:19:13 -07:00
committed by GitHub
parent 1b83ebadce
commit 0a3c6d72fa
2 changed files with 97 additions and 1 deletions
@@ -60,7 +60,7 @@ public class MetadataController {
public ResponseEntity<BookMetadata> updateMetadata(
@Parameter(description = "Metadata update wrapper") @RequestBody MetadataUpdateWrapper metadataUpdateWrapper,
@Parameter(description = "ID of the book") @PathVariable long bookId,
@Parameter(description = "Merge categories") @RequestParam(defaultValue = "true") boolean mergeCategories) {
@Parameter(description = "Merge categories") @RequestParam(defaultValue = "false") boolean mergeCategories) {
BookEntity bookEntity = bookRepository.findAllWithMetadataByIds(java.util.Collections.singleton(bookId)).stream()
.findFirst()
.orElseThrow(() -> ApiError.BOOK_NOT_FOUND.createException(bookId));