Skip to content

Commit

Permalink
fix(webui): duplicate pages show total size saving
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Jan 27, 2022
1 parent 388c4f5 commit e9bf064
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion komga-webui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions komga-webui/src/types/komga-pagehashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface PageHashUnknownDto {
mediaType: string,
sizeBytes?: number,
size?: string,
totalSize?: string,
matchCount: number,
}

Expand Down
9 changes: 8 additions & 1 deletion komga-webui/src/views/SettingsDuplicatePages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@
<v-card-text>
<div>{{ element.mediaType }}</div>
<div>{{ element.size || $t('duplicate_pages.unknown_size') }}</div>

<v-btn
@click="showDialogMatches(element)"
outlined
rounded
class="mt-2"
class="my-4"
>
{{ $tc('duplicate_pages.matches_n', element.matchCount) }}
</v-btn>

<div
v-if="element.totalSize"
style="max-width: 100px"
>{{ $t('duplicate_pages.delete_to_save', {size: element.totalSize}) }}
</div>
</v-card-text>
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit e9bf064

Please sign in to comment.