Browse Source

rmove tmp folder

master
P.BARRY 7 years ago
parent
commit
5b8e219b5b
5 changed files with 25 additions and 7 deletions
  1. 14
      index.js
  2. 5
      package-lock.json
  3. 1
      package.json
  4. 10
      server/booth.js
  5. 2
      server/views/scope.ejs

14
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

5
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",

1
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",

10
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) {

2
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();
}
}

Loading…
Cancel
Save