mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
MOBI output: Set the document type by the publication type in the document metadata
This commit is contained in:
parent
45366b0df5
commit
6ad3575579
@ -1980,7 +1980,12 @@ class MobiWriter(object):
|
|||||||
elif self._periodicalCount and self._sectionCount == 1 :
|
elif self._periodicalCount and self._sectionCount == 1 :
|
||||||
mobiType = 0x102
|
mobiType = 0x102
|
||||||
elif self._periodicalCount and self._sectionCount > 1 :
|
elif self._periodicalCount and self._sectionCount > 1 :
|
||||||
mobiType = 0x103 # Could also be 0x101 - need cli switch
|
pt = None
|
||||||
|
if self._oeb.metadata.publication_type:
|
||||||
|
x = self._oeb.metadata.publication_type[0].split(':')
|
||||||
|
if len(x) > 1:
|
||||||
|
pt = x[1]
|
||||||
|
mobiType = {'newspaper':0x101}.get(pt, 0x103)
|
||||||
else :
|
else :
|
||||||
raise NotImplementedError('_generate_ctoc: Unrecognized document structured')
|
raise NotImplementedError('_generate_ctoc: Unrecognized document structured')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user