mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #2576 (chm files) and handle empty TOCs in the conversion pipeline
This commit is contained in:
parent
0b9f489e25
commit
d596ed0341
@ -25,7 +25,7 @@ class DRMError(ValueError):
|
|||||||
BOOK_EXTENSIONS = ['lrf', 'rar', 'zip', 'rtf', 'lit', 'txt', 'htm', 'xhtm',
|
BOOK_EXTENSIONS = ['lrf', 'rar', 'zip', 'rtf', 'lit', 'txt', 'htm', 'xhtm',
|
||||||
'html', 'xhtml', 'pdf', 'pdb', 'prc', 'mobi', 'azw', 'doc',
|
'html', 'xhtml', 'pdf', 'pdb', 'prc', 'mobi', 'azw', 'doc',
|
||||||
'epub', 'fb2', 'djvu', 'lrx', 'cbr', 'cbz', 'oebzip',
|
'epub', 'fb2', 'djvu', 'lrx', 'cbr', 'cbz', 'oebzip',
|
||||||
'rb', 'imp', 'odt']
|
'rb', 'imp', 'odt', 'chm']
|
||||||
|
|
||||||
class HTMLRenderer(object):
|
class HTMLRenderer(object):
|
||||||
|
|
||||||
|
@ -1327,7 +1327,9 @@ class TOC(object):
|
|||||||
return len(list(self.iter())) - 1
|
return len(list(self.iter())) - 1
|
||||||
|
|
||||||
def next_play_order(self):
|
def next_play_order(self):
|
||||||
return max([x.play_order for x in self.iter()])+1
|
entries = [x.play_order for x in self.iter()]
|
||||||
|
base = max(entries) if entries else 0
|
||||||
|
return base+1
|
||||||
|
|
||||||
def has_href(self, href):
|
def has_href(self, href):
|
||||||
for x in self.iter():
|
for x in self.iter():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user