E-book viewer: Indicate if a KF8 file is a joint MOBI

This commit is contained in:
Kovid Goyal 2013-08-27 18:54:25 +05:30
parent d5a7efdefa
commit 097ea82129
2 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class MOBIInput(InputFormatPlugin):
def convert(self, stream, options, file_ext, log,
accelerators):
self.is_kf8 = False
self.mobi_is_joint = False
from calibre.ebooks.mobi.reader.mobi6 import MobiReader
from lxml import html
@ -35,6 +36,8 @@ class MOBIInput(InputFormatPlugin):
if mr.kf8_type is not None:
log('Found KF8 MOBI of type %r'%mr.kf8_type)
if mr.kf8_type == 'joint':
self.mobi_is_joint = True
from calibre.ebooks.mobi.reader.mobi8 import Mobi8Reader
mr = Mobi8Reader(mr, log)
opf = os.path.abspath(mr())

View File

@ -113,7 +113,8 @@ class EbookIterator(BookmarksMixin):
self.book_format = os.path.splitext(self.pathtoebook)[1][1:].upper()
if getattr(plumber.input_plugin, 'is_kf8', False):
self.book_format = 'KF8'
fs = ':joint' if getattr(plumber.input_plugin, 'mobi_is_joint', False) else ''
self.book_format = 'KF8' + fs
self.opf = getattr(plumber.input_plugin, 'optimize_opf_parsing', None)
if self.opf is None: