fix(api): request param conflict

This commit is contained in:
Gauthier Roebroeck 2022-01-28 09:28:55 +08:00
parent f25c74f759
commit 160c767c40
5 changed files with 6 additions and 6 deletions

View file

@ -75,7 +75,7 @@ export function transientBookPageUrl(transientBookId: string, page: number): str
}
export function pageHashUnknownThumbnailUrl(pageHash: PageHashUnknownDto, resize?: number): string {
let url = `${urls.originNoSlash}/api/v1/page-hashes/unknown/${pageHash.hash}/thumbnail?media_type=${pageHash.mediaType}&size=${pageHash.sizeBytes || -1}`
let url = `${urls.originNoSlash}/api/v1/page-hashes/unknown/${pageHash.hash}/thumbnail?media_type=${pageHash.mediaType}&file_size=${pageHash.sizeBytes || -1}`
if(resize) {
url += `&resize=${resize}`
}

View file

@ -32,7 +32,7 @@ export default class KomgaPageHashesService {
const params = {
...pageRequest,
media_type: hash.mediaType,
size: hash.sizeBytes || -1,
file_size: hash.sizeBytes || -1,
}
return (await this.http.get(`${API_PAGE_HASH}/unknown/${hash.hash}`, {
params: params,

View file

@ -168,7 +168,7 @@ export default Vue.extend({
sortOptions(): SortOption[] {
return [
{name: this.$t('duplicate_pages.filter.total_size').toString(), key: 'totalSize'},
{name: this.$t('duplicate_pages.filter.size').toString(), key: 'size'},
{name: this.$t('duplicate_pages.filter.size').toString(), key: 'fileSize'},
{name: this.$t('duplicate_pages.filter.count').toString(), key: 'matchCount'},
]
},

View file

@ -26,7 +26,7 @@ class PageHashDao(
private val sorts = mapOf(
"hash" to p.FILE_HASH,
"mediatype" to p.MEDIA_TYPE,
"size" to p.FILE_SIZE,
"fileSize" to p.FILE_SIZE,
"matchCount" to DSL.field("count"),
"totalSize" to DSL.field("totalSize"),
"url" to b.URL,

View file

@ -63,7 +63,7 @@ class PageHashController(
fun getUnknownPageHashMatches(
@PathVariable pageHash: String,
@RequestParam("media_type") mediaType: String,
@RequestParam("size") size: Long,
@RequestParam("file_size") size: Long,
@Parameter(hidden = true) page: Pageable,
): Page<PageHashMatchDto> =
pageHashRepository.findMatchesByHash(
@ -80,7 +80,7 @@ class PageHashController(
fun getUnknownPageHashThumbnail(
@PathVariable pageHash: String,
@RequestParam("media_type") mediaType: String,
@RequestParam("size") size: Long,
@RequestParam("file_size") size: Long,
@RequestParam("resize") resize: Int? = null,
): ResponseEntity<ByteArray> =
pageHashLifecycle.getPage(