mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
a1ce8f3eaa
commit
1c8058fff6
@ -34,7 +34,7 @@ def set_azw3_cover(container, cover_path, report, options=None):
|
|||||||
container.insert_into_xml(guide, guide.makeelement(
|
container.insert_into_xml(guide, guide.makeelement(
|
||||||
OPF('reference'), href=href, type='cover'))
|
OPF('reference'), href=href, type='cover'))
|
||||||
if not existing_image:
|
if not existing_image:
|
||||||
with open(cover_path, 'rb') as src, container.open(name, 'wb') as dest:
|
with lopen(cover_path, 'rb') as src, container.open(name, 'wb') as dest:
|
||||||
shutil.copyfileobj(src, dest)
|
shutil.copyfileobj(src, dest)
|
||||||
container.dirty(container.opf_name)
|
container.dirty(container.opf_name)
|
||||||
report(_('Cover updated') if found else _('Cover inserted'))
|
report(_('Cover updated') if found else _('Cover inserted'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user