From 97c2d1dd668fefc2b32cb3372f2910455b7485c0 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 7 Oct 2018 15:47:03 -0700 Subject: [PATCH] Second part of size update implemented to trigger hash regeneration Signed-off-by: James Ketrenos --- server/scanner.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/scanner.js b/server/scanner.js index 0eabebc..095c6ae 100755 --- a/server/scanner.js +++ b/server/scanner.js @@ -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;