diff --git a/src/calibre/ebooks/mobi/debug/index.py b/src/calibre/ebooks/mobi/debug/index.py index 488adef05d..e4e5caf8f8 100644 --- a/src/calibre/ebooks/mobi/debug/index.py +++ b/src/calibre/ebooks/mobi/debug/index.py @@ -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) diff --git a/src/calibre/ebooks/mobi/debug/mobi8.py b/src/calibre/ebooks/mobi/debug/mobi8.py index 803d5e5667..213e15cf85 100644 --- a/src/calibre/ebooks/mobi/debug/mobi8.py +++ b/src/calibre/ebooks/mobi/debug/mobi8.py @@ -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,