Use kindlegen major version based on OS

This commit is contained in:
Kovid Goyal 2014-03-29 12:12:23 +05:30
parent c621ce6645
commit a814e8429e

View File

@ -11,6 +11,7 @@ import re
from struct import pack from struct import pack
from io import BytesIO from io import BytesIO
from calibre.constants import iswindows, isosx
from calibre.ebooks.mobi.utils import (utf8_text, to_base) from calibre.ebooks.mobi.utils import (utf8_text, to_base)
from calibre.utils.localization import lang_as_iso639_1 from calibre.utils.localization import lang_as_iso639_1
from calibre.ebooks.metadata import authors_to_sort_string from calibre.ebooks.metadata import authors_to_sort_string
@ -149,7 +150,8 @@ def build_exth(metadata, prefer_author_sort=False, is_periodical=False,
nrecs += 1 nrecs += 1
if be_kindlegen2: if be_kindlegen2:
vals = {204:202, 205:2, 206:9, 207:0} mv = 200 if iswindows else 202 if isosx else 201
vals = {204:mv, 205:2, 206:9, 207:0}
elif is_periodical: elif is_periodical:
# Pretend to be amazon's super secret periodical generator # Pretend to be amazon's super secret periodical generator
vals = {204:201, 205:2, 206:0, 207:101} vals = {204:201, 205:2, 206:0, 207:101}