Second part of size update implemented to trigger hash regeneration

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-10-07 15:47:03 -07:00
parent a391848ec9
commit 97c2d1dd66

View File

@ -607,10 +607,9 @@ function findOrUpdateDBAsset(transaction, asset) {
/* If the size on disk changed, update the size entry in the DB. This shouldn't happen in
* production unless someone modifies the file, then re-stamps the modified time */
if (asset.size != results[0].size) {
return photoDB.sequelize.query("UPDATE photos SET size=:size WHERE id=:id", {
replacements: asset,
transaction: transaction
});
console.log("File was modified with time-restamp (HASH regeneration will be queued): " + asset.filename);
delete asset.scanned;
delete asset.modified;
}
}).then(function() {
return asset;