clean-up and using config to select days of videos to fetch

database
Mark Cotton 2023-09-11 22:27:54 -05:00
parent 28f47ac2ba
commit 281b5be9ff
1 changed files with 4 additions and 3 deletions

7
app.py
View File

@ -35,12 +35,14 @@ if config:
if 'log_level' in config:
logger.setLevel(config['log_level'])
else:
logging.setLevel('INFO')
if 'client_secret' in config:
SECRET_KEY = config['client_secret']
else:
logging.setLevel(config['INFO'])
logging.setLevel('INFO')
@ -250,7 +252,6 @@ def logout():
return redirect(url_for('index'))
def save_list_of_cameras(een=None):
user = User.query.filter(User.email == een.current_user['email']).first()
if user:
@ -402,7 +403,7 @@ def camera_list_of_videos(esn=None):
een = session['een']
camera = een.get_camera_by_id(esn)
logging.debug(camera.get_list_of_videos(start_timestamp=een.time_before(hours=24), end_timestamp=een.time_now()))
logging.debug(camera.get_list_of_videos(start_timestamp=een.time_before(hours=24 * DAYS_OF_HISTORY), end_timestamp=een.time_now()))
db_camera = Camera.query.filter(Camera.device_id == esn).first()
if db_camera: