fix missing detector_motion_count array

merge-requests/180/head
Moe 2020-03-29 10:47:21 -07:00
parent ec1041c389
commit 21b2de65fd
1 changed files with 6 additions and 3 deletions

View File

@ -32,6 +32,7 @@ module.exports = function(s,config,lang){
// if(!s.group[e.ke].activeMonitors[e.mid].viewerConnection){s.group[e.ke].activeMonitors[e.mid].viewerConnection={}};
// if(!s.group[e.ke].activeMonitors[e.mid].viewerConnectionCount){s.group[e.ke].activeMonitors[e.mid].viewerConnectionCount=0};
if(!s.group[e.ke].activeMonitors[e.mid].parsedObjects){s.group[e.ke].activeMonitors[e.mid].parsedObjects={}};
if(!s.group[e.ke].activeMonitors[e.mid].detector_motion_count){s.group[e.ke].activeMonitors[e.mid].detector_motion_count=[]};
if(!s.group[e.ke].activeMonitors[e.mid].isStarted){s.group[e.ke].activeMonitors[e.mid].isStarted = false};
if(s.group[e.ke].activeMonitors[e.mid].delete){clearTimeout(s.group[e.ke].activeMonitors[e.mid].delete)}
if(!s.group[e.ke].rawMonitorConfigurations){s.group[e.ke].rawMonitorConfigurations={}}
@ -1081,10 +1082,12 @@ module.exports = function(s,config,lang){
// s.group[e.ke].activeMonitors[e.id].spawn.stdio[3].pipe(s.group[e.ke].activeMonitors[e.id].p2p).pipe(s.group[e.ke].activeMonitors[e.id].pamDiff)
s.group[e.ke].activeMonitors[e.id].spawn.stdio[3].on('data',function(buf){
try{
var data = JSON.parse(buf)
s.triggerEvent(data)
var data = JSON.parse(buf)
s.triggerEvent(data)
} catch(err){
console.log(buf.toString())
console.log(err)
console.error('There was an error parsing a detection event')
console.error(buf.toString())
}
})
if(e.details.detector_use_detect_object === '1'){