From e9bf064cb2accd47545f16fe6359c1f8e4858dae Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Thu, 27 Jan 2022 10:35:48 +0800 Subject: [PATCH] fix(webui): duplicate pages show total size saving --- komga-webui/src/locales/en.json | 3 ++- komga-webui/src/types/komga-pagehashes.ts | 1 + komga-webui/src/views/SettingsDuplicatePages.vue | 9 ++++++++- .../komga/interfaces/api/rest/dto/PageHashUnknownDto.kt | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/komga-webui/src/locales/en.json b/komga-webui/src/locales/en.json index e50ba6c06..e8f6b2589 100644 --- a/komga-webui/src/locales/en.json +++ b/komga-webui/src/locales/en.json @@ -534,7 +534,8 @@ "action_ignore": "Ignore", "matches_n": "No matches | 1 match | {count} matches", "title": "Duplicate pages", - "unknown_size": "Unknown size" + "unknown_size": "Unknown size", + "delete_to_save": "Delete to save {size}" }, "duplicates": { "file_hash": "File hash", diff --git a/komga-webui/src/types/komga-pagehashes.ts b/komga-webui/src/types/komga-pagehashes.ts index d73fae87f..3c1c688b2 100644 --- a/komga-webui/src/types/komga-pagehashes.ts +++ b/komga-webui/src/types/komga-pagehashes.ts @@ -3,6 +3,7 @@ export interface PageHashUnknownDto { mediaType: string, sizeBytes?: number, size?: string, + totalSize?: string, matchCount: number, } diff --git a/komga-webui/src/views/SettingsDuplicatePages.vue b/komga-webui/src/views/SettingsDuplicatePages.vue index 875fdc327..c9ebd1e90 100644 --- a/komga-webui/src/views/SettingsDuplicatePages.vue +++ b/komga-webui/src/views/SettingsDuplicatePages.vue @@ -31,14 +31,21 @@
{{ element.mediaType }}
{{ element.size || $t('duplicate_pages.unknown_size') }}
+ {{ $tc('duplicate_pages.matches_n', element.matchCount) }} + +
{{ $t('duplicate_pages.delete_to_save', {size: element.totalSize}) }} +
diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashUnknownDto.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashUnknownDto.kt index b3defbe7c..77a9f414b 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashUnknownDto.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/PageHashUnknownDto.kt @@ -8,6 +8,7 @@ data class PageHashUnknownDto( val mediaType: String, val sizeBytes: Long?, val size: String? = sizeBytes?.let { BinaryByteUnit.format(it) }, + val totalSize: String ? = sizeBytes?.let { BinaryByteUnit.format(it * matchCount) }, val matchCount: Int, )