mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
FB2 Output: Fix bug #8172, Include cover page in output when it is not referenced in the oeb spine.
This commit is contained in:
parent
0357e638cb
commit
2427c5bdd0
@ -161,6 +161,17 @@ class FB2MLizer(object):
|
|||||||
text.append('<section>')
|
text.append('<section>')
|
||||||
self.section_level += 1
|
self.section_level += 1
|
||||||
|
|
||||||
|
# Insert the title page / cover into the spine if it is not already referenced.
|
||||||
|
title_name = u''
|
||||||
|
if 'titlepage' in self.oeb_book.guide:
|
||||||
|
title_name = 'titlepage'
|
||||||
|
elif 'cover' in self.oeb_book.guide:
|
||||||
|
title_name = 'cover'
|
||||||
|
if title_name:
|
||||||
|
title_item = self.oeb_book.manifest.hrefs[self.oeb_book.guide[title_name].href]
|
||||||
|
if title_item.spine_position is None and title_item.media_type == 'application/xhtml+xml':
|
||||||
|
self.oeb_book.spine.insert(0, title_item, True)
|
||||||
|
|
||||||
for item in self.oeb_book.spine:
|
for item in self.oeb_book.spine:
|
||||||
self.log.debug('Converting %s to FictionBook2 XML' % item.href)
|
self.log.debug('Converting %s to FictionBook2 XML' % item.href)
|
||||||
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts, self.opts.output_profile)
|
stylizer = Stylizer(item.data, item.href, self.oeb_book, self.opts, self.opts.output_profile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user