Remove all use of spread
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
44e62f6119
commit
5a91c89730
@ -182,7 +182,7 @@ require("./db/photos").then(function(db) {
|
|||||||
return photoDB.sequelize.query("INSERT INTO faces (photoId,top,left,bottom,right,faceConfidence) " +
|
return photoDB.sequelize.query("INSERT INTO faces (photoId,top,left,bottom,right,faceConfidence) " +
|
||||||
"VALUES (:id,:top,:left,:bottom,:right,:faceConfidence)", {
|
"VALUES (:id,:top,:left,:bottom,:right,:faceConfidence)", {
|
||||||
replacements: replacements
|
replacements: replacements
|
||||||
}).spread((results, metadata) => {
|
}).then(([ results, metadata ]) => {
|
||||||
return metadata.lastID;
|
return metadata.lastID;
|
||||||
}).then((id) => {
|
}).then((id) => {
|
||||||
const path = facesPath + (id % 100);
|
const path = facesPath + (id % 100);
|
||||||
|
@ -69,7 +69,7 @@ router.post("/", (req, res) => {
|
|||||||
"(" + fields.join(",") + ") " +
|
"(" + fields.join(",") + ") " +
|
||||||
"VALUES(:" + fields.join(",:") + ")", {
|
"VALUES(:" + fields.join(",:") + ")", {
|
||||||
replacements: identity,
|
replacements: identity,
|
||||||
}).spread(function(results, metadata) {
|
}).then(([ results, metadata ]) => {
|
||||||
identity.id = metadata.lastID;
|
identity.id = metadata.lastID;
|
||||||
return photoDB.sequelize.query("UPDATE faces SET identityId=:identityId,identityDistance=0 " +
|
return photoDB.sequelize.query("UPDATE faces SET identityId=:identityId,identityDistance=0 " +
|
||||||
"WHERE id IN (:faceIds)", {
|
"WHERE id IN (:faceIds)", {
|
||||||
|
@ -189,7 +189,7 @@ require("../server/db/photos").then(function(db) {
|
|||||||
return photoDB.sequelize.query("INSERT INTO photos " +
|
return photoDB.sequelize.query("INSERT INTO photos " +
|
||||||
"(albumId,filename,name,size) VALUES(:albumId,:filename,:name,:size)", {
|
"(albumId,filename,name,size) VALUES(:albumId,:filename,:name,:size)", {
|
||||||
replacements: asset
|
replacements: asset
|
||||||
}).spread(function(results, metadata) {
|
}).then(([ results, metadata ]) => {
|
||||||
asset.id = metadata.lastID;
|
asset.id = metadata.lastID;
|
||||||
});
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user