mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-02 09:43:27 +01:00
Ignore empty/missing media-types in manifest
This commit is contained in:
parent
32523e852c
commit
d2ed3045df
1 changed files with 3 additions and 2 deletions
|
|
@ -300,9 +300,10 @@ def refresh_mime_map(self):
|
|||
for item in self.opf_xpath('//opf:manifest/opf:item[@href and @media-type]'):
|
||||
href = item.get('href')
|
||||
name = self.href_to_name(href, self.opf_name)
|
||||
if name in self.mime_map and name != self.opf_name:
|
||||
mt = item.get('media-type')
|
||||
if name in self.mime_map and name != self.opf_name and mt:
|
||||
# some epubs include the opf in the manifest with an incorrect mime type
|
||||
self.mime_map[name] = item.get('media-type')
|
||||
self.mime_map[name] = mt
|
||||
|
||||
def data_for_clone(self, dest_dir=None):
|
||||
dest_dir = dest_dir or self.root
|
||||
|
|
|
|||
Loading…
Reference in a new issue