From 0ca17dad7fa65e2e34823b59b95dd00bb1066b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emrik=20=C3=96stling?= Date: Tue, 15 Sep 2026 20:57:46 +0200 Subject: [PATCH] Merge commit from fork --- src/converters/calibre.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/converters/calibre.ts b/src/converters/calibre.ts index af06eb4f..952f79d8 100644 --- a/src/converters/calibre.ts +++ b/src/converters/calibre.ts @@ -27,7 +27,6 @@ export const properties = { "pml", "rb", "rtf", - "recipe", "snb", "tcr", "txt", @@ -67,6 +66,18 @@ export async function convert( options?: unknown, execFile: ExecFileFn = execFileOriginal, // to make it mockable ): Promise { + const normalizedFileType = fileType.toLowerCase(); + const fileExt = (filePath.split(".").pop() ?? "").toLowerCase(); + + if ( + normalizedFileType === "recipe" || + normalizedFileType === "downloaded_recipe" || + fileExt === "recipe" || + fileExt === "downloaded_recipe" + ) { + throw new Error("Recipe files are not supported"); + } + return new Promise((resolve, reject) => { execFile("ebook-convert", [filePath, targetPath], (error, stdout, stderr) => { if (error) {