This commit is contained in:
2025-12-15 16:21:06 +01:00
parent 5d8441bf27
commit f1f95953dd
19 changed files with 429 additions and 144 deletions

View File

@@ -226,15 +226,26 @@ async function getBookInfoExtension(ext, id) {
try {
return JSON.parse(cached.metadata);
}
catch {
}
catch { }
}
if (ext.type === 'book-board' && ext.getMetadata) {
try {
const info = await ext.getMetadata(id);
if (info) {
await (0, queries_1.cacheExtension)(extName, id, info.title, info);
return info;
const normalized = {
id: info.id ?? id,
title: info.title ?? "",
format: info.format ?? "",
score: typeof info.score === "number" ? info.score : null,
genres: Array.isArray(info.genres) ? info.genres : [],
status: info.status ?? "",
published: info.published ?? "",
summary: info.summary ?? "",
chapters: Number.isFinite(info.chapters) ? info.chapters : 1,
image: typeof info.image === "string" ? info.image : ""
};
await (0, queries_1.cacheExtension)(extName, id, normalized.title, normalized);
return [normalized];
}
}
catch (e) {