Skip to content

Commit

Permalink
Minor format enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng committed Oct 16, 2022
1 parent e5460a2 commit 3e373a0
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions motioneye/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,7 @@ def webcontrol_interface(v, data):


def netcam_keepalive_params(v, data):
if v == True:
v = 'on'

elif v == False:
v = 'off'
v = 'on' if v == True else 'off' if v == False else v # value can be 'force' as well

if 'netcam_params' in data and data['netcam_params']:
return {'netcam_params': data['netcam_params'] + ',keepalive = ' + v}
Expand All @@ -198,28 +194,21 @@ def netcam_keepalive_params(v, data):


def netcam_tolerant_check_params(v, data):
if v:
v = 'on'
else:
v = 'off'

v = 'on' if v else 'off'

if 'netcam_params' in data and data['netcam_params']:
return {'netcam_params': data['netcam_params'] + ',tolerant_check = ' + v}

return {'netcam_params': 'tolerant_check = ' + v}


def netcam_use_tcp_params(v, data):
if 'netcam_params' in data and data['netcam_params']:
if v:
return {'netcam_params': data['netcam_params'] + ',rtsp_transport = tcp'}

return {'netcam_params': data['netcam_params'] + ',rtsp_transport = udp'}
v = 'tcp' if v else 'udp'

if v:
return {'netcam_params': 'rtsp_transport = tcp'}
if 'netcam_params' in data and data['netcam_params']:
return {'netcam_params': data['netcam_params'] + ',rtsp_transport = ' + v}

return {'netcam_params': 'rtsp_transport = udp'}
return {'netcam_params': 'rtsp_transport = ' + v}


def netcam_params(v, data):
Expand Down

0 comments on commit 3e373a0

Please sign in to comment.