mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: Fix a bug in removal of invalid entries from the spine, where not all invalid entries were removed, causing conversion to fail. Fixes #1086054 (ePub->MOBI conversion fails (url of input included))
This commit is contained in:
parent
e26b9f770e
commit
f53daffda9
@ -320,13 +320,11 @@ class OEBReader(object):
|
|||||||
self.logger.warn(u'Spine item %r not found' % idref)
|
self.logger.warn(u'Spine item %r not found' % idref)
|
||||||
continue
|
continue
|
||||||
item = manifest.ids[idref]
|
item = manifest.ids[idref]
|
||||||
spine.add(item, elem.get('linear'))
|
if item.media_type.lower() in OEB_DOCS and hasattr(item.data, 'xpath'):
|
||||||
for item in spine:
|
spine.add(item, elem.get('linear'))
|
||||||
if item.media_type.lower() not in OEB_DOCS:
|
else:
|
||||||
if not hasattr(item.data, 'xpath'):
|
self.oeb.log.warn('The item %s is not a XML document.'
|
||||||
self.oeb.log.warn('The item %s is not a XML document.'
|
' Removing it from spine.'%item.href)
|
||||||
' Removing it from spine.'%item.href)
|
|
||||||
spine.remove(item)
|
|
||||||
if len(spine) == 0:
|
if len(spine) == 0:
|
||||||
raise OEBError("Spine is empty")
|
raise OEBError("Spine is empty")
|
||||||
self._spine_add_extra()
|
self._spine_add_extra()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user