feat: fetch-novel builds an EPUB from any plugin; Kavita TOC fix
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:
masi
2026-09-25 13:40:23 -03:00
parent fbb91a9c84
commit fba9a35075
4 changed files with 307 additions and 106 deletions
+4 -2
View File
@@ -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);