feat: enhance character status extraction and update schema for nullable status
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user