mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Detect an NCX TOC which isn't mentioned by the /spine/@toc.
This commit is contained in:
parent
9a30cdc3f2
commit
6550c18745
@ -602,7 +602,10 @@ class OEBBook(object):
|
|||||||
def _toc_from_ncx(self, opf):
|
def _toc_from_ncx(self, opf):
|
||||||
result = xpath(opf, '/o2:package/o2:spine/@toc')
|
result = xpath(opf, '/o2:package/o2:spine/@toc')
|
||||||
if not result:
|
if not result:
|
||||||
return False
|
expr = '/o2:package/o2:manifest/o2:item[@media-type="%s"]/@id'
|
||||||
|
result = xpath(opf, expr % NCX_MIME)
|
||||||
|
if len(result) != 1:
|
||||||
|
return False
|
||||||
id = result[0]
|
id = result[0]
|
||||||
ncx = self.manifest[id].data
|
ncx = self.manifest[id].data
|
||||||
self.manifest.remove(id)
|
self.manifest.remove(id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user