From 212cecdc9c5ac02bcae66ba804c2979b003b09cf Mon Sep 17 00:00:00 2001 From: "dennis.cartier" Date: Wed, 24 Jun 2020 16:50:53 -0400 Subject: [PATCH] Fix too early of insertion of detector_motion_count before all returns have been considered --- libs/events.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/events.js b/libs/events.js index 15745e4e..ef03021d 100644 --- a/libs/events.js +++ b/libs/events.js @@ -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({