Merge commit from fork

This commit is contained in:
Emrik Östling
2026-09-15 20:57:46 +02:00
committed by GitHub
parent 3b37849651
commit 0ca17dad7f
+12 -1
View File
@@ -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<string> {
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) {