mirror of
https://github.com/ciromattia/kcc
synced 2026-09-22 10:47:08 +00:00
prevent creating non Kindle MOBI (#1307)
This commit is contained in:
@@ -1470,6 +1470,15 @@ def checkOptions(options):
|
|||||||
options.isKobo = False
|
options.isKobo = False
|
||||||
options.bordersColor = None
|
options.bordersColor = None
|
||||||
options.keep_epub = False
|
options.keep_epub = False
|
||||||
|
|
||||||
|
if options.profile in image.ProfileData.ProfilesKindle.keys():
|
||||||
|
options.iskindle = True
|
||||||
|
else:
|
||||||
|
options.isKobo = True
|
||||||
|
|
||||||
|
if not options.iskindle and ('MOBI' in options.format or 'EPUB-200MB' in options.format):
|
||||||
|
raise UserWarning('MOBI/EPUB-200MB not supported for non-Kindle profiles')
|
||||||
|
|
||||||
if options.format == 'PDF-200MB':
|
if options.format == 'PDF-200MB':
|
||||||
options.targetsize = 195
|
options.targetsize = 195
|
||||||
options.format = 'PDF'
|
options.format = 'PDF'
|
||||||
@@ -1501,10 +1510,7 @@ def checkOptions(options):
|
|||||||
options.format = 'PDF'
|
options.format = 'PDF'
|
||||||
else:
|
else:
|
||||||
options.format = 'EPUB'
|
options.format = 'EPUB'
|
||||||
if options.profile in image.ProfileData.ProfilesKindle.keys():
|
|
||||||
options.iskindle = True
|
|
||||||
else:
|
|
||||||
options.isKobo = True
|
|
||||||
if options.white_borders:
|
if options.white_borders:
|
||||||
options.bordersColor = 'white'
|
options.bordersColor = 'white'
|
||||||
if options.black_borders:
|
if options.black_borders:
|
||||||
@@ -1556,6 +1562,7 @@ def checkOptions(options):
|
|||||||
options.jpegquality = 90
|
options.jpegquality = 90
|
||||||
else:
|
else:
|
||||||
options.jpegquality = 85
|
options.jpegquality = 85
|
||||||
|
|
||||||
options.kindle_azw3 = options.iskindle and ('MOBI' in options.format or 'EPUB' in options.format)
|
options.kindle_azw3 = options.iskindle and ('MOBI' in options.format or 'EPUB' in options.format)
|
||||||
options.kindle_scribe_azw3 = options.profile.startswith('KS') and options.kindle_azw3
|
options.kindle_scribe_azw3 = options.profile.startswith('KS') and options.kindle_azw3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user