diff --git a/server/scanner.js b/server/scanner.js index 86b2e17..ad92fee 100644 --- a/server/scanner.js +++ b/server/scanner.js @@ -175,10 +175,13 @@ const { spawn } = require('child_process'); const sharp = require("sharp"), exif = require("exif-reader"); function mkdirPromise(path) { + if (path.indexOf(picturesPath) != 0) { + path = picturesPath + path; + } return new Promise(function(resolve, reject) { - fs.stat(path, function(err, stats) { + fs.stat(path, function(err) { if (err && err.code != 'ENOENT') { - console.warn("Could not stat " + path + "/raw"); + console.warn("Could not stat " + path); return reject(); } @@ -188,7 +191,7 @@ function mkdirPromise(path) { fs.mkdir(path, function(err) { if (err) { - return reject("Unable to create " + path, err); + return reject("Unable to create " + path + "\n" + err); } return resolve(); });