Switched to tabs. Adding missing actor entries when scraping actors, with batch ID.

This commit is contained in:
2020-05-14 04:26:05 +02:00
parent f1eb29c713
commit 11eb66f834
178 changed files with 16594 additions and 16929 deletions

View File

@@ -3,29 +3,29 @@
const { fetchActors } = require('../actors');
async function fetchActorsApi(req, res) {
const actorId = typeof req.params.actorId === 'number' ? req.params.actorId : null;
const actorSlug = typeof req.params.actorId === 'string' ? req.params.actorId : null;
const actorId = typeof req.params.actorId === 'number' ? req.params.actorId : null;
const actorSlug = typeof req.params.actorId === 'string' ? req.params.actorId : null;
if (actorId || actorSlug) {
const actors = await fetchActors({
id: actorId,
slug: actorSlug,
});
if (actorId || actorSlug) {
const actors = await fetchActors({
id: actorId,
slug: actorSlug,
});
if (actors.length > 0) {
res.send(actors[0]);
return;
}
if (actors.length > 0) {
res.send(actors[0]);
return;
}
res.status(404).send();
return;
}
res.status(404).send();
return;
}
const actors = await fetchActors(null, req.query.limit);
const actors = await fetchActors(null, req.query.limit);
res.send(actors);
res.send(actors);
}
module.exports = {
fetchActors: fetchActorsApi,
fetchActors: fetchActorsApi,
};