]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed a bug where extra motion options could not be removed
authorCalin Crisan <ccrisan@gmail.com>
Sun, 26 Jul 2015 18:32:56 +0000 (21:32 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 26 Jul 2015 18:41:35 +0000 (21:41 +0300)
motioneye.py
src/config.py
static/css/ui.css

index 1beb6ec7948e7b3e15860b451fef178ec0eca716..3dbde2dff6ea9ede747a1814c80692ad1777622f 100755 (executable)
@@ -39,7 +39,7 @@ sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'src'))
 import settings
 import update
 
-VERSION = '0.24'
+VERSION = '0.25.1'
 
 
 def _configure_settings():
index 4772108e8f71485283d8b5775461612cc0406448..d941ebba7cb60a26e3dc1444c799611ae0bce488 100644 (file)
@@ -52,6 +52,16 @@ _additional_structure_cache = {}
 # starting with r490 motion config directives have changed a bit 
 _LAST_OLD_CONFIG_VERSIONS = (490, '3.2.12')
 
+_KNOWN_MOTION_OPTIONS = set([
+    'auto_brightness', 'brightness', 'contrast', 'emulate_motion', 'event_gap', 'ffmpeg_bps', 'ffmpeg_output_movies', 'ffmpeg_variable_bitrate', 'ffmpeg_video_codec',
+    'framerate', 'height', 'hue', 'lightswitch', 'locate_motion_mode', 'locate_motion_style', 'minimum_motion_frames', 'movie_filename', 'max_movie_time', 'max_mpeg_time',
+    'noise_level', 'noise_tune', 'on_event_end', 'on_event_start', 'output_pictures', 'picture_filename', 'post_capture', 'pre_capture', 'quality', 'rotate', 'saturation',
+    'snapshot_filename', 'snapshot_interval', 'stream_auth_method', 'stream_authentication', 'stream_localhost', 'stream_maxrate', 'stream_motion', 'stream_port', 'stream_quality',
+    'target_dir', 'text_changes', 'text_double', 'text_left', 'text_right', 'threshold', 'videodevice', 'width',
+    'webcam_localhost', 'webcam_port', 'webcam_maxrate', 'webcam_quality', 'webcam_motion', 'ffmpeg_cap_new', 'output_normal', 'output_motion', 'jpeg_filename', 'output_all', 'gap', 'locate',
+    'netcam_url', 'netcam_userpass', 'netcam_http', 'netcam_tolerant_check', 'netcam_keepalive'
+])
+
 
 def additional_section(func):
     _additional_section_funcs.append(func)
@@ -854,6 +864,10 @@ def motion_camera_ui_to_dict(ui, old_config=None):
         data['@' + name] = value
         
     # extra motion options
+    for name in old_config.keys():
+        if name not in _KNOWN_MOTION_OPTIONS and not name.startswith('@'):
+            old_config.pop(name)
+
     extra_options = ui.get('extra_options', [])
     for name, value in extra_options:
         data[name] = value or ''
@@ -1158,19 +1172,9 @@ def motion_camera_dict_to_ui(data):
         ui[name[1:]] = value
     
     # extra motion options
-    known_options = set([
-        'auto_brightness', 'brightness', 'contrast', 'emulate_motion', 'event_gap', 'ffmpeg_bps', 'ffmpeg_output_movies', 'ffmpeg_variable_bitrate', 'ffmpeg_video_codec',
-        'framerate', 'height', 'hue', 'lightswitch', 'locate_motion_mode', 'locate_motion_style', 'minimum_motion_frames', 'movie_filename', 'max_movie_time', 'max_mpeg_time',
-        'noise_level', 'noise_tune', 'on_event_end', 'on_event_start', 'output_pictures', 'picture_filename', 'post_capture', 'pre_capture', 'quality', 'rotate', 'saturation',
-        'snapshot_filename', 'snapshot_interval', 'stream_auth_method', 'stream_authentication', 'stream_localhost', 'stream_maxrate', 'stream_motion', 'stream_port', 'stream_quality',
-        'target_dir', 'text_changes', 'text_double', 'text_left', 'text_right', 'threshold', 'videodevice', 'width',
-        'webcam_localhost', 'webcam_port', 'webcam_maxrate', 'webcam_quality', 'webcam_motion', 'ffmpeg_cap_new', 'output_normal', 'output_motion', 'jpeg_filename', 'output_all', 'gap', 'locate',
-        'netcam_url', 'netcam_userpass', 'netcam_http', 'netcam_tolerant_check', 'netcam_keepalive'
-    ])
-
     extra_options = []
     for name, value in data.iteritems():
-        if name not in known_options and not name.startswith('@'):
+        if name not in _KNOWN_MOTION_OPTIONS and not name.startswith('@'):
             extra_options.append((name, value))
 
     ui['extra_options'] = extra_options
index e3eb78c552b58bb1f2935062757dfd6f899f3fe6..7c77c83ac29d93b855595252966aeec1f9032b37 100644 (file)
@@ -144,6 +144,7 @@ textarea.styled {
     transition: all 0.1s ease;
     resize: none;
     vertical-align: middle;
+    white-space: nowrap;
 }
 
 input[type=password].styled:FOCUS,