Fix too early of insertion of detector_motion_count before all returns have been considered

merge-requests/210/head
dennis.cartier 2020-06-24 16:50:53 -04:00
parent 98bc29e8eb
commit 212cecdc9c
1 changed files with 4 additions and 4 deletions

View File

@ -380,10 +380,6 @@ module.exports = function(s,config,lang){
}
}
var eventTime = new Date()
//motion counter
if(filter.addToMotionCounter && filter.record){
s.group[d.ke].activeMonitors[d.id].detector_motion_count.push(d)
}
if(filter.countObjects && currentConfig.detector_obj_count === '1' && currentConfig.detector_obj_count_in_region !== '1'){
didCountingAlready = true
countObjects(d)
@ -440,6 +436,10 @@ module.exports = function(s,config,lang){
// fails indifference check for modified indifference
return
}
//motion counter
if(filter.addToMotionCounter && filter.record){
s.group[d.ke].activeMonitors[d.id].detector_motion_count.push(d)
}
//
if(d.doObjectDetection === true){
s.ocvTx({