Improved q so missing date element returns null.

This commit is contained in:
2020-01-25 01:46:58 +01:00
parent 3891a6e86b
commit ab82329171
2 changed files with 16 additions and 9 deletions

View File

@@ -339,13 +339,18 @@ async function scrapeActors(actorNames) {
const sources = argv.sources ? argv.sources.map(source => [source, scrapers.actors[source]]) : Object.entries(scrapers.actors);
const profiles = await Promise.map(sources, async ([scraperSlug, scraper]) => {
const profile = await scraper.fetchProfile(actorEntry ? actorEntry.name : actorName);
try {
const profile = await scraper.fetchProfile(actorEntry ? actorEntry.name : actorName);
return {
...profile,
name: actorName,
scraper: scraperSlug,
};
return {
...profile,
name: actorName,
scraper: scraperSlug,
};
} catch (error) {
console.log(scraperSlug, error);
return null;
}
});
const profile = await mergeProfiles(profiles, actorEntry);