mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5445 (Covers are not generated if Checkbox "Read Data from File only" is selected)
This commit is contained in:
parent
c9bcd9a35b
commit
db7a29f0fc
@ -180,6 +180,10 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
self.formats_changed = True
|
self.formats_changed = True
|
||||||
|
|
||||||
def get_selected_format_metadata(self):
|
def get_selected_format_metadata(self):
|
||||||
|
old = prefs['read_file_metadata']
|
||||||
|
if not old:
|
||||||
|
prefs['read_file_metadata'] = True
|
||||||
|
try:
|
||||||
row = self.formats.currentRow()
|
row = self.formats.currentRow()
|
||||||
fmt = self.formats.item(row)
|
fmt = self.formats.item(row)
|
||||||
if fmt is None:
|
if fmt is None:
|
||||||
@ -201,6 +205,9 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
error_dialog(self, _('Could not read metadata'),
|
error_dialog(self, _('Could not read metadata'),
|
||||||
_('Could not read metadata from %s format')%ext).exec_()
|
_('Could not read metadata from %s format')%ext).exec_()
|
||||||
return None, None
|
return None, None
|
||||||
|
finally:
|
||||||
|
if old != prefs['read_file_metadata']:
|
||||||
|
prefs['read_file_metadata'] = old
|
||||||
|
|
||||||
def set_metadata_from_format(self):
|
def set_metadata_from_format(self):
|
||||||
mi, ext = self.get_selected_format_metadata()
|
mi, ext = self.get_selected_format_metadata()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user