mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-24 12:03:16 +02:00
Book polishing: Do not error out when updating covers in EPUB files that have entries int heir manifest that point to missing files
This commit is contained in:
parent
d4a18a2a19
commit
ebf4068ebc
1 changed files with 3 additions and 1 deletions
|
|
@ -94,7 +94,9 @@ def __init__(self, rootpath, opfpath, log):
|
|||
# Update mime map with data from the OPF
|
||||
for item in self.opf_xpath('//opf:manifest/opf:item[@href and @media-type]'):
|
||||
href = item.get('href')
|
||||
self.mime_map[self.href_to_name(href, self.opf_name)] = item.get('media-type')
|
||||
name = self.href_to_name(href, self.opf_name)
|
||||
if name in self.mime_map:
|
||||
self.mime_map[name] = item.get('media-type')
|
||||
|
||||
def abspath_to_name(self, fullpath):
|
||||
return self.relpath(os.path.abspath(fullpath)).replace(os.sep, '/')
|
||||
|
|
|
|||
Loading…
Reference in a new issue