This commit is contained in:
Kovid Goyal 2022-08-23 07:48:30 +05:30
parent 4991254b7c
commit 3262f50962
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1272,12 +1272,13 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
self.db.clean() self.db.clean()
if args.do_compress_cover: if args.do_compress_cover:
total_old, total_new = bb.cover_sizes['old'], bb.cover_sizes['new'] total_old, total_new = bb.cover_sizes['old'], bb.cover_sizes['new']
percent = (total_old - total_new) / total_old if total_old > 0:
info_dialog(self, _('Covers compressed'), _( percent = (total_old - total_new) / total_old
'Covers were compressed by {percent:.1%} from a total size of' info_dialog(self, _('Covers compressed'), _(
' {old} to {new}.').format( 'Covers were compressed by {percent:.1%} from a total size of'
percent=percent, old=human_readable(total_old), new=human_readable(total_new)) ' {old} to {new}.').format(
).exec() percent=percent, old=human_readable(total_old), new=human_readable(total_new))
).exec()
return QDialog.accept(self) return QDialog.accept(self)
def series_changed(self, *args): def series_changed(self, *args):