From 495aef0064044d2364fbb892d4c814325a3d8afd Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Mon, 11 Sep 2023 14:03:54 +0800 Subject: [PATCH] KF8: remove KindleUnpack compat - KindleUnpack's rules for when to insert the coverpage seems a bit too involved to replicate exactly. - The feature is marked "XXX experimental" in KindleUnpack source code after 10 years. - The feature makes no sense as the cover page might not even exist in the source EPUB in the first place. It seems to me now that it might be better to just bite the bullet. --- mobi.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mobi.js b/mobi.js index 713ffa4..3262004 100644 --- a/mobi.js +++ b/mobi.js @@ -971,18 +971,13 @@ class KF8 { } } - // insert cover page for CFI compatibility with KindleUnpack, - // which will pretty much always insert a cover page; - // it will not be accessible in any way, so just insert a dummy section - this.#sections.unshift({ frags: [] }) - this.sections = this.#sections.map((section, index) => section.frags.length ? ({ id: index, load: () => this.loadSection(section), createDocument: () => this.createDocument(section), size: section.length, - pageSpread: pageSpreads.get(index - 1), + pageSpread: pageSpreads.get(index), }) : ({ linear: 'no' })) try {