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.
This commit is contained in:
John Factotum
2023-09-11 14:03:54 +08:00
parent e7009357a2
commit 495aef0064
+1 -6
View File
@@ -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) => this.sections = this.#sections.map((section, index) =>
section.frags.length ? ({ section.frags.length ? ({
id: index, id: index,
load: () => this.loadSection(section), load: () => this.loadSection(section),
createDocument: () => this.createDocument(section), createDocument: () => this.createDocument(section),
size: section.length, size: section.length,
pageSpread: pageSpreads.get(index - 1), pageSpread: pageSpreads.get(index),
}) : ({ linear: 'no' })) }) : ({ linear: 'no' }))
try { try {