diff --git a/index.js b/index.js index 7a49afc..f811fa5 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,18 @@ const gphoto2 = require('./tools/tools-gphoto2') const server = require('./server') -gphoto2.init(function (pErr) { - console.log('[>] Checking list done with success') +const args = require('args-parser')(process.argv) + +const PKG = require('./package') + +if (args.noinit) { let app = server() -}) +} else { + gphoto2.init(function (pErr) { + console.log('[>] Checking list done with success') + let app = server() + }) +} // killall gvfs-gphoto2-volume-monitor diff --git a/package-lock.json b/package-lock.json index 1154a07..bffad5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,11 @@ "readable-stream": "2.3.6" } }, + "args-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/args-parser/-/args-parser-1.1.0.tgz", + "integrity": "sha1-YlO/zWlNJ5/mPqr9eNYo0UoF/6k=" + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", diff --git a/package.json b/package.json index 87e78e6..93c85c8 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "author": "P.BARRY", "license": "ISC", "dependencies": { + "args-parser": "^1.1.0", "async": "^2.6.1", "body-parser": "^1.18.3", "colors": "^1.3.1", diff --git a/server/booth.js b/server/booth.js index a8156be..dc415ef 100644 --- a/server/booth.js +++ b/server/booth.js @@ -16,7 +16,7 @@ const CTX = { return CTX.__io }, inProgress: 0, - testPath: '/tmp/bobinoscope-test.jpg' + testPath: path.join(CFG.output, 'bobinoscope-test.jpg') } booth.init() @@ -32,7 +32,9 @@ setGamepad() router.get('/dslr/takepicture/:boothId/:pictId', function (req, res, next) { // return res.json({}) gphoto2.takeOnePicture(req.params.boothId, req.params.pictId, function (pErr) { - res.json({ error: pErr, data: null }) + let error = typeof pErr === 'string' ? pErr : JSON.stringigy(pErr) + if (pErr) console.error(pErr) + res.json({ error: error, data: null }) }) }) @@ -78,7 +80,7 @@ router.get('/print/:pictId', function (req, res, next) { // TEST router.get('/test/takepicture', function (req, res, next) { - let tmpPict = '/tmp/bobinoscope-test.tmp.jpg' + let tmpPict = path.join(CFG.output, 'bobinoscope-test.tmp.jpg') gphoto2.__takeOnePicture(tmpPict, function (pErr) { if (pErr) return res.status(500).send(pErr) gm(tmpPict) @@ -92,7 +94,7 @@ router.get('/test/takepicture', function (req, res, next) { }) router.get('/test/takepicture/result', function (req, res, next) { - res.sendFile('/tmp/bobinoscope-test.jpg') + res.sendFile(path.join(CFG.output, 'bobinoscope-test.jpg')) }) router.setSocketIo = function (pIo) { diff --git a/server/views/scope.ejs b/server/views/scope.ejs index 118ea0c..3c00c1b 100644 --- a/server/views/scope.ejs +++ b/server/views/scope.ejs @@ -135,6 +135,7 @@ function BOB_countdown() { $('#idViewCountdown').fadeIn(); + $('#idViewCountdown').css('fontSize', '20em') $('#idViewCountdown').html(BOB_var_context.onGoingTimer); // if( BOB_var_context.onGoingTimer > 5 ) { @@ -152,6 +153,7 @@ }, 1000) } else { $('#idViewCountdown').html("Souriez"); + $('#idViewCountdown').css('fontSize', '14em') BOB_takeThe1Pictures(); } }