fix
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user