mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1987361 [Exception in Bulk Metadata dialog](https://bugs.launchpad.net/calibre/+bug/1987361)
This commit is contained in:
parent
4991254b7c
commit
3262f50962
@ -1272,12 +1272,13 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
||||
self.db.clean()
|
||||
if args.do_compress_cover:
|
||||
total_old, total_new = bb.cover_sizes['old'], bb.cover_sizes['new']
|
||||
percent = (total_old - total_new) / total_old
|
||||
info_dialog(self, _('Covers compressed'), _(
|
||||
'Covers were compressed by {percent:.1%} from a total size of'
|
||||
' {old} to {new}.').format(
|
||||
percent=percent, old=human_readable(total_old), new=human_readable(total_new))
|
||||
).exec()
|
||||
if total_old > 0:
|
||||
percent = (total_old - total_new) / total_old
|
||||
info_dialog(self, _('Covers compressed'), _(
|
||||
'Covers were compressed by {percent:.1%} from a total size of'
|
||||
' {old} to {new}.').format(
|
||||
percent=percent, old=human_readable(total_old), new=human_readable(total_new))
|
||||
).exec()
|
||||
return QDialog.accept(self)
|
||||
|
||||
def series_changed(self, *args):
|
||||
|
Loading…
x
Reference in New Issue
Block a user