mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ignore empty/missing media-types in manifest
This commit is contained in:
parent
32523e852c
commit
d2ed3045df
@ -300,9 +300,10 @@ class Container(ContainerBase): # {{{
|
||||
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…
x
Reference in New Issue
Block a user