mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #6595 (Missing last chapter mark in kindle (in some books))
This commit is contained in:
parent
dbcbc5979d
commit
3817baa67c
@ -2043,12 +2043,16 @@ class MobiWriter(object):
|
|||||||
else :
|
else :
|
||||||
self._oeb.logger.info("chapterCount: %d" % self._chapterCount)
|
self._oeb.logger.info("chapterCount: %d" % self._chapterCount)
|
||||||
|
|
||||||
if True:
|
# Apparently the CTOC must end with a null byte
|
||||||
rec_count = len(self._ctoc_records)
|
self._ctoc.write('\0')
|
||||||
self._oeb.logger.info(" CNCX utilization: %d %s %.0f%% full" % \
|
|
||||||
(rec_count + 1, 'records, last record' if rec_count else 'record,', len(self._ctoc.getvalue())/655) )
|
|
||||||
|
|
||||||
return align_block(self._ctoc.getvalue())
|
ctoc = self._ctoc.getvalue()
|
||||||
|
rec_count = len(self._ctoc_records)
|
||||||
|
self._oeb.logger.info(" CNCX utilization: %d %s %.0f%% full" % \
|
||||||
|
(rec_count + 1, 'records, last record' if rec_count else 'record,',
|
||||||
|
len(ctoc)/655) )
|
||||||
|
|
||||||
|
return align_block(ctoc)
|
||||||
|
|
||||||
def _write_periodical_node(self, indxt, indices, index, offset, length, count, firstSection, lastSection) :
|
def _write_periodical_node(self, indxt, indices, index, offset, length, count, firstSection, lastSection) :
|
||||||
pos = 0xc0 + indxt.tell()
|
pos = 0xc0 + indxt.tell()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user