Skip to content

Commit 1eed373

Browse files
author
ddd999
committed
Code cleanup
1 parent 8f97180 commit 1eed373

File tree

1 file changed

+0
-78
lines changed

1 file changed

+0
-78
lines changed

server/index.js

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,6 @@ try {
832832
}
833833
winston.info(`Camera started successfully in ${mode} mode.`);
834834

835-
// ---> ADD LOGGING <---
836-
console.log("--- /api/camera/start Sending Response ---");
837-
console.log("Start result:", { active, addresses });
838-
console.log("-----------------------------------------");
839-
// ---> END LOGGING <---
840-
841835
res.send(JSON.stringify({ active: active, addresses: addresses || [], error: null }));
842836
});
843837

@@ -863,39 +857,6 @@ vManager.stopCamera((err, active) => { // active should be false after stop
863857
});
864858
});
865859

866-
// if (!err) {
867-
// winston.error('Error getting video devices:', err);
868-
// res.setHeader('Content-Type', 'application/json')
869-
// res.send(JSON.stringify({
870-
// ifaces: vManager.ifaces,
871-
// dev: devices,
872-
// vidDeviceSelected: seldevice,
873-
// vidres: vidres,
874-
// vidResSelected: selRes,
875-
// streamingStatus: active,
876-
// streamAddresses: vManager.deviceAddresses,
877-
// rotSelected: selRot,
878-
// bitrate: selbitrate,
879-
// fpsSelected: selfps,
880-
// UDPChecked: SeluseUDP,
881-
// useUDPIP: SeluseUDPIP,
882-
// useUDPPort: SeluseUDPPort,
883-
// timestamp,
884-
// error: null,
885-
// fps: fps,
886-
// FPSMax: FPSMax,
887-
// enableCameraHeartbeat: useCameraHeartbeat,
888-
// mavStreamSelected: selMavURI,
889-
// cameraMode: selCameraMode
890-
// }))
891-
// } else {
892-
// res.setHeader('Content-Type', 'application/json')
893-
// res.send(JSON.stringify({ error: err }))
894-
// winston.info('Error in /api/videodevices ', { message: err })
895-
// }
896-
// })
897-
// })
898-
899860
app.get('/api/hardwareinfo', authenticateToken, (req, res) => {
900861
aboutPage.getHardwareInfo((RAM, CPU, hatData, sysData, err) => {
901862
if (!err) {
@@ -1137,45 +1098,6 @@ app.get('/api/networkconnections', authenticateToken, (req, res) => {
11371098
})
11381099
})
11391100

1140-
// app.post('/api/startstopvideo', authenticateToken, [check('active').isBoolean(),
1141-
// check('device').if(check('active').isIn([true])).isLength({ min: 2 }),
1142-
// check('height').if(check('active').isIn([true])).isInt({ min: 1 }),
1143-
// check('width').if(check('active').isIn([true])).isInt({ min: 1 }),
1144-
// check('useUDP').if(check('active').isIn([true])).isBoolean(),
1145-
// check('useTimestamp').if(check('active').isIn([true])).isBoolean(),
1146-
// check('useCameraHeartbeat').if(check('active').isIn([true])).isBoolean(),
1147-
// check('cameraMode').if(check('active').isIn([true])).isIn(['streaming', 'photo', 'video']),
1148-
// check('useUDPPort').if(check('active').isIn([true])).isPort(),
1149-
// check('useUDPIP').if(check('active').isIn([true])).isIP(),
1150-
// check('bitrate').if(check('active').isIn([true])).isInt({ min: 50, max: 50000 }),
1151-
// check('format').if(check('active').isIn([true])).isIn(['video/x-raw', 'video/x-h264', 'image/jpeg']),
1152-
// check('fps').if(check('active').isIn([true])).isInt({ min: -1, max: 100 }),
1153-
// check('rotation').if(check('active').isIn([true])).isInt().isIn([0, 90, 180, 270])],
1154-
// check('compression').if(check('active').isIn([true])).isIn(['H264', 'H265']), (req, res) => {
1155-
// const errors = validationResult(req)
1156-
// if (!errors.isEmpty()) {
1157-
// winston.info('Bad POST vars in /api/startstopvideo ', { message: errors.array() })
1158-
// const ret = { streamingStatus: false, streamAddresses: [], error: ['Error ' + JSON.stringify(errors.array())] }
1159-
// return res.status(422).json(ret)
1160-
// }
1161-
// // user wants to start/stop video streaming
1162-
// vManager.startStopStreaming(req.body.active, req.body.device, req.body.height, req.body.width, req.body.format, req.body.rotation,
1163-
// req.body.bitrate, req.body.fps, req.body.useUDP, req.body.useUDPIP, req.body.useUDPPort,
1164-
// req.body.useTimestamp, req.body.useCameraHeartbeat, req.body.mavStreamSelected, req.body.cameraMode,
1165-
// req.body.compression, (err, status, addresses) => {
1166-
// if (!err) {
1167-
// res.setHeader('Content-Type', 'application/json')
1168-
// const ret = { streamingStatus: status, streamAddresses: addresses }
1169-
// res.send(JSON.stringify(ret))
1170-
// } else {
1171-
// res.setHeader('Content-Type', 'application/json')
1172-
// const ret = { streamingStatus: false, streamAddresses: ['Error ' + err] }
1173-
// res.send(JSON.stringify(ret))
1174-
// winston.info('Error in /api/startstopvideo ', { message: err })
1175-
// }
1176-
// })
1177-
// })
1178-
11791101
// Get details of a network connection by connection ID
11801102
app.post('/api/networkIP', authenticateToken, [check('conName').isUUID()], (req, res) => {
11811103
// Finds the validation errors in this request and wraps them in an object with handy functions

0 commit comments

Comments
 (0)