mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix jacket detection in azw3
This commit is contained in:
parent
29a45f9670
commit
a22f077018
@ -31,10 +31,15 @@ def is_current_jacket(root):
|
|||||||
def find_existing_jacket(container):
|
def find_existing_jacket(container):
|
||||||
for item in container.spine_items:
|
for item in container.spine_items:
|
||||||
name = container.abspath_to_name(item)
|
name = container.abspath_to_name(item)
|
||||||
if name.rpartition('/')[-1].startswith('jacket') and name.endswith('.xhtml'):
|
if container.book_type == 'azw3':
|
||||||
root = container.parsed(name)
|
root = container.parsed(name)
|
||||||
if is_current_jacket(root) or is_legacy_jacket(root):
|
if is_current_jacket(root):
|
||||||
return name
|
return name
|
||||||
|
else:
|
||||||
|
if name.rpartition('/')[-1].startswith('jacket') and name.endswith('.xhtml'):
|
||||||
|
root = container.parsed(name)
|
||||||
|
if is_current_jacket(root) or is_legacy_jacket(root):
|
||||||
|
return name
|
||||||
|
|
||||||
def replace_jacket(container, name):
|
def replace_jacket(container, name):
|
||||||
root = render_jacket(container.mi)
|
root = render_jacket(container.mi)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user