mirror of
https://github.com/gotson/komga.git
synced 2025-12-20 07:23:34 +01:00
fix(api): cannot delete duplicate page match if it is unknown
This commit is contained in:
parent
db990baea6
commit
a6dece2b81
1 changed files with 4 additions and 8 deletions
|
|
@ -127,8 +127,7 @@ class PageHashController(
|
|||
@RequestParam("media_type") mediaType: String,
|
||||
@RequestParam("file_size") size: Long,
|
||||
) {
|
||||
val hash = pageHashRepository.findKnown(PageHash(pageHash, mediaType, size))
|
||||
?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
val hash = PageHash(pageHash, mediaType, size)
|
||||
|
||||
val toRemove = pageHashRepository.findMatchesByHash(hash, null, Pageable.unpaged())
|
||||
.groupBy(
|
||||
|
|
@ -155,17 +154,14 @@ class PageHashController(
|
|||
@RequestParam("file_size") size: Long,
|
||||
@RequestBody matchDto: PageHashMatchDto,
|
||||
) {
|
||||
val hash = pageHashRepository.findKnown(PageHash(pageHash, mediaType, size))
|
||||
?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
|
||||
val toRemove = Pair(
|
||||
matchDto.bookId,
|
||||
listOf(
|
||||
BookPageNumbered(
|
||||
fileName = matchDto.fileName,
|
||||
mediaType = hash.mediaType,
|
||||
fileHash = hash.hash,
|
||||
fileSize = hash.size,
|
||||
mediaType = mediaType,
|
||||
fileHash = pageHash,
|
||||
fileSize = size,
|
||||
pageNumber = matchDto.pageNumber,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue