feat: fetch-novel builds an EPUB from any plugin; Kavita TOC fix
Publish Plugins / Publish Plugins (push) Has been cancelled
Publish Plugins / Publish Plugins (push) Has been cancelled
- scripts/load-plugins.js: shared plugin loader for the novel CLI scripts - scripts/fetch-novel.js: download a novel via its plugin into a clean EPUB 3 - find-novel prints the plugin id/path for each match - kavita 1.0.1: innermost TOC entry names the chapter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ class KavitaPlugin implements Plugin.PluginBase {
|
||||
id = 'kavita';
|
||||
name = 'Kavita';
|
||||
icon = 'src/multi/kavita/icon.png';
|
||||
version = '1.0.0';
|
||||
version = '1.0.1';
|
||||
site = 'https://www.kavitareader.com';
|
||||
|
||||
pluginSettings = {
|
||||
@@ -166,10 +166,12 @@ class KavitaPlugin implements Plugin.PluginBase {
|
||||
for (const book of books) {
|
||||
const toc = await this.json<TocItem[]>(`Book/${book.id}/chapters`);
|
||||
const titles = new Map<number, string>();
|
||||
// Innermost entry wins: a "Part"/"Contents" parent often shares its
|
||||
// page with the first chapter below it.
|
||||
const walk = (items: TocItem[]) =>
|
||||
items.forEach(item => {
|
||||
if (!titles.has(item.page)) titles.set(item.page, item.title);
|
||||
if (item.children?.length) walk(item.children);
|
||||
if (!titles.has(item.page)) titles.set(item.page, item.title);
|
||||
});
|
||||
walk(toc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user