]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed wrong frames showing progress when applying settings
authorCalin Crisan <ccrisan@gmail.com>
Sat, 10 Dec 2016 19:17:06 +0000 (21:17 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 10 Dec 2016 19:17:06 +0000 (21:17 +0200)
motioneye/static/js/main.js

index 016b2f1f2ec3b11d1f19853c45e97527f11407af..a627a60d9ec39787872878fac3fe9a92273221ce 100644 (file)
@@ -2455,31 +2455,28 @@ function doApply() {
     }
     
     function actualApply() {
+        var cameraIdsByInstance = getCameraIdsByInstance();
+
         /* gather the affected motion instances */
         var affectedInstances = {};
+        
         Object.keys(pushConfigs).forEach(function (key) {
-            var config = pushConfigs[key];
-            if (key === 'main') {
+            if (key == 'main') {
                 return;
             }
             
-            var instance;
-            if (config.proto == 'netcam' || config.proto == 'v4l2') {
-                instance = '';
-            }
-            else if (config.proto == 'motioneye') { /* motioneye */
-                instance = config.host || '';
-                if (config.port) {
-                    instance += ':' + config.port;
+            /* key is a camera id */
+            Object.keys(cameraIdsByInstance).forEach(function (instance) {
+                var cameraIds = cameraIdsByInstance[instance];
+                if (cameraIds.indexOf(parseInt(key)) >= 0) {
+                    affectedInstances[instance] = true;
                 }
-            }
-            
-            affectedInstances[instance] = true;
+            });
         });
+
         affectedInstances = Object.keys(affectedInstances);
         
         /* compute the affected camera ids */ 
-        var cameraIdsByInstance = getCameraIdsByInstance();
         var affectedCameraIds = [];
         
         affectedInstances.forEach(function (instance) {