feat: enhance character status extraction and update schema for nullable status
All checks were successful
Build Docker Image / build (push) Successful in 1m22s

This commit is contained in:
2026-03-03 23:26:53 +01:00
parent 70de84f3ab
commit b5816e6c28
4 changed files with 165 additions and 27 deletions

View File

@@ -659,9 +659,9 @@ function extractOrigin($: cheerio.CheerioAPI): string | null {
/**
* Extract status from infobox
*/
function extractStatus($: cheerio.CheerioAPI): string {
function extractStatus($: cheerio.CheerioAPI): string | null {
const div = $('[data-source="statut"] .pi-data-value');
if (div.length === 0) return 'Alive';
if (div.length === 0) return null;
const statusText = div.text().trim().toLowerCase();
@@ -669,6 +669,8 @@ function extractStatus($: cheerio.CheerioAPI): string {
return 'Alive';
} else if (statusText.includes('décédé')) {
return 'Dead';
} else if (statusText.includes('inconnu')) {
return 'Unknown';
}
return 'Alive';