Delete and rename now working on duplicates

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-10-11 20:52:52 -07:00
parent 734fc13967
commit 14f1051f4d

View File

@ -184,7 +184,20 @@ const getPhoto = function(id) {
return null;
}
return photos[0];
if (!photos[0].duplicate) {
return photos[0];
}
return photoDB.sequelize.query("SELECT hash FROM photohashes WHERE photoId=:duplicate", {
replacements: photos[0],
type: photoDB.Sequelize.QueryTypes.SELECT,
raw: true
}).then(function(results) {
if (results.length != 0) {
photos[0].hash = results[0].hash;
}
return photos[0];
});
});
}