1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

Make it easier to add new profiles (#764)

* refactor

* put pw12 under oasis profile

* remove kindle 12 tag

* separate ebok and pdoc

* put cs 12 on top
This commit is contained in:
Alex Xu
2024-11-04 20:24:12 -08:00
committed by GitHub
parent f7f19b99da
commit 5168cd73c4
4 changed files with 37 additions and 27 deletions

View File

@@ -957,8 +957,7 @@ def makeParser():
help="Full path to comic folder or file(s) to be processed.")
main_options.add_argument("-p", "--profile", action="store", dest="profile", default="KV",
help="Device profile (Available options: K1, K2, K34, K578, KDX, KPW, KPW5, KPW6, KCS12, KV, KO, "
"K11, KS, KoMT, KoG, KoGHD, KoA, KoAHD, KoAH2O, KoAO, KoN, KoC, KoCC, KoL, KoLC, KoF, KoS, KoE)"
help=f"Device profile (Available options: {', '.join(image.ProfileData.Profiles.keys())})"
" [Default=KV]")
main_options.add_argument("-m", "--manga-style", action="store_true", dest="righttoleft", default=False,
help="Manga style (right-to-left reading and splitting)")
@@ -1046,16 +1045,15 @@ def checkOptions(options):
options.kfx = False
options.supportSyntheticSpread = False
if options.format == 'Auto':
if options.profile in ['K1', 'K2', 'K34', 'K578', 'KPW', 'KPW5', 'KPW6', 'KCS12', 'KV', 'KO', 'K11', 'KS']:
options.format = 'MOBI'
elif options.profile in ['OTHER', 'KoMT', 'KoG', 'KoGHD', 'KoA', 'KoAHD', 'KoAH2O', 'KoAO',
'KoN', 'KoC', 'KoCC', 'KoL', 'KoLC', 'KoF', 'KoS', 'KoE']:
options.format = 'EPUB'
elif options.profile in ['KDX']:
if options.profile in ['KDX']:
options.format = 'CBZ'
if options.profile in ['K1', 'K2', 'K34', 'K578', 'KPW', 'KPW5', 'KPW6', 'KCS12', 'KV', 'KO', 'K11', 'KS']:
elif options.profile in image.ProfileData.ProfilesKindle.keys():
options.format = 'MOBI'
else:
options.format = 'EPUB'
if options.profile in image.ProfileData.ProfilesKindle.keys():
options.iskindle = True
elif options.profile in ['OTHER', 'KoMT', 'KoG', 'KoGHD', 'KoA', 'KoAHD', 'KoAH2O', 'KoAO', 'KoN', 'KoC', 'KoCC', 'KoL', 'KoLC', 'KoF', 'KoS', 'KoE']:
else:
options.isKobo = True
# Other Kobo devices probably support synthetic spreads as well, but
# they haven't been tested.