Fix spread usage

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2020-01-05 23:05:10 -08:00
parent 0fc593e8ab
commit 4f7b677185

View File

@ -64,8 +64,9 @@ require("./db/photos").then(function(db) {
console.log(`Scanning ${args.length} faces.`);
return Promise.map(args, (arg) => {
const file = arg,
id = parseInt(arg);
const file = arg;
let id = parseInt(arg);
let loader;
@ -129,7 +130,11 @@ require("./db/photos").then(function(db) {
});
}
return loader.spread((filepath, image, detectors) => {
return loader.then((results) => {
const filepath = results[0],
image = results[1],
detectors = results[2];
process.stdout.write(`${detectors.length} faces.\n`);
return Promise.map(detectors, (face, index) => {