mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix a regression in 0.7.33 that broke updating covers in ebook files when saving to disk. Fixes #7886 (Possible bug in setting new cover)
This commit is contained in:
parent
c20a6359d0
commit
be0f3b096a
@ -253,6 +253,7 @@ def do_save_book_to_disk(id_, mi, cover, plugboards,
|
|||||||
if not os.path.exists(dirpath):
|
if not os.path.exists(dirpath):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
ocover = mi.cover
|
||||||
if opts.save_cover and cover and os.access(cover, os.R_OK):
|
if opts.save_cover and cover and os.access(cover, os.R_OK):
|
||||||
with open(base_path+'.jpg', 'wb') as f:
|
with open(base_path+'.jpg', 'wb') as f:
|
||||||
with open(cover, 'rb') as s:
|
with open(cover, 'rb') as s:
|
||||||
@ -266,6 +267,8 @@ def do_save_book_to_disk(id_, mi, cover, plugboards,
|
|||||||
with open(base_path+'.opf', 'wb') as f:
|
with open(base_path+'.opf', 'wb') as f:
|
||||||
f.write(opf)
|
f.write(opf)
|
||||||
|
|
||||||
|
mi.cover = ocover
|
||||||
|
|
||||||
written = False
|
written = False
|
||||||
for fmt in formats:
|
for fmt in formats:
|
||||||
global plugboard_save_to_disk_value, plugboard_any_format_value
|
global plugboard_save_to_disk_value, plugboard_any_format_value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user