mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Mobi debug: Write the kind field from NCX entries as well
This commit is contained in:
parent
eff927bbc4
commit
8283515d51
@ -159,7 +159,7 @@ class NCXIndex(Index):
|
||||
|
||||
if self.table is not None:
|
||||
NCXEntry = namedtuple('NCXEntry', 'index start length depth parent '
|
||||
'first_child last_child title pos_fid')
|
||||
'first_child last_child title pos_fid kind')
|
||||
|
||||
for num, x in enumerate(self.table.iteritems()):
|
||||
text, tag_map = x
|
||||
@ -192,7 +192,7 @@ class NCXIndex(Index):
|
||||
length=e['len'], depth=e['hlvl'], parent=refindx(e,
|
||||
'parent'), first_child=refindx(e, 'child1'),
|
||||
last_child=refindx(e, 'childn'), title=e['text'],
|
||||
pos_fid=e['pos_fid'])
|
||||
pos_fid=e['pos_fid'], kind=e['kind'])
|
||||
self.records.append(entry)
|
||||
|
||||
|
||||
|
@ -193,7 +193,7 @@ class MOBIFile(object):
|
||||
entry_map = []
|
||||
for index in self.ncx_index:
|
||||
vals = list(index)[:-1] + [None, None, None, None]
|
||||
entry_map.append(Entry(*vals))
|
||||
entry_map.append(Entry(*(vals[:12])))
|
||||
|
||||
|
||||
indexing_data = collect_indexing_data(entry_map, list(map(len,
|
||||
|
Loading…
x
Reference in New Issue
Block a user