mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 21:00:16 +02: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("media_type") mediaType: String,
|
||||||
@RequestParam("file_size") size: Long,
|
@RequestParam("file_size") size: Long,
|
||||||
) {
|
) {
|
||||||
val hash = pageHashRepository.findKnown(PageHash(pageHash, mediaType, size))
|
val hash = PageHash(pageHash, mediaType, size)
|
||||||
?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
|
||||||
|
|
||||||
val toRemove = pageHashRepository.findMatchesByHash(hash, null, Pageable.unpaged())
|
val toRemove = pageHashRepository.findMatchesByHash(hash, null, Pageable.unpaged())
|
||||||
.groupBy(
|
.groupBy(
|
||||||
|
|
@ -155,17 +154,14 @@ class PageHashController(
|
||||||
@RequestParam("file_size") size: Long,
|
@RequestParam("file_size") size: Long,
|
||||||
@RequestBody matchDto: PageHashMatchDto,
|
@RequestBody matchDto: PageHashMatchDto,
|
||||||
) {
|
) {
|
||||||
val hash = pageHashRepository.findKnown(PageHash(pageHash, mediaType, size))
|
|
||||||
?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
|
||||||
|
|
||||||
val toRemove = Pair(
|
val toRemove = Pair(
|
||||||
matchDto.bookId,
|
matchDto.bookId,
|
||||||
listOf(
|
listOf(
|
||||||
BookPageNumbered(
|
BookPageNumbered(
|
||||||
fileName = matchDto.fileName,
|
fileName = matchDto.fileName,
|
||||||
mediaType = hash.mediaType,
|
mediaType = mediaType,
|
||||||
fileHash = hash.hash,
|
fileHash = pageHash,
|
||||||
fileSize = hash.size,
|
fileSize = size,
|
||||||
pageNumber = matchDto.pageNumber,
|
pageNumber = matchDto.pageNumber,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue