fix(webui): duplicate page matches show filenames

This commit is contained in:
Gauthier Roebroeck 2022-01-27 10:26:04 +08:00
parent 5844521286
commit 388c4f5f30
6 changed files with 9 additions and 2 deletions

View File

@ -67,6 +67,7 @@ export default Vue.extend({
headers(): object[] {
return [
{text: this.$t('common.url').toString(), value: 'url'},
{text: this.$t('common.filename').toString(), value: 'fileName'},
{text: this.$t('common.page_number').toString(), value: 'pageNumber'},
{text: this.$t('common.page').toString(), value: 'bookId'},
]

View File

@ -190,6 +190,7 @@
"dismiss": "Dismiss",
"download": "Download",
"email": "Email",
"filename": "Filename",
"filter_no_matches": "The active filter has no matches",
"genre": "Genre",
"go_to_library": "Go to library",

View File

@ -6,8 +6,9 @@ export interface PageHashUnknownDto {
matchCount: number,
}
export interface PageHashMatchDto{
export interface PageHashMatchDto {
bookId: string,
url: string,
pageNumber: number,
fileName: string,
}

View File

@ -6,4 +6,5 @@ data class PageHashMatch(
val bookId: String,
val url: URL,
val pageNumber: Int,
val fileName: String,
)

View File

@ -69,7 +69,7 @@ class PageHashDao(
}
override fun findMatchesByHash(pageHash: PageHashUnknown, pageable: Pageable): Page<PageHashMatch> {
val query = dsl.select(p.BOOK_ID, b.URL, p.NUMBER)
val query = dsl.select(p.BOOK_ID, b.URL, p.NUMBER, p.FILE_NAME)
.from(p)
.leftJoin(b).on(p.BOOK_ID.eq(b.ID))
.where(p.FILE_HASH.eq(pageHash.hash))
@ -90,6 +90,7 @@ class PageHashDao(
bookId = it.value1(),
url = URL(it.value2()),
pageNumber = it.value3() + 1,
fileName = it.value4(),
)
}

View File

@ -7,6 +7,7 @@ data class PageHashMatchDto(
val bookId: String,
val url: String,
val pageNumber: Int,
val fileName: String,
)
fun PageHashMatch.toDto() =
@ -14,4 +15,5 @@ fun PageHashMatch.toDto() =
bookId = bookId,
url = url.toFilePath(),
pageNumber = pageNumber,
fileName = fileName,
)