From 281b5be9ffd5688af9cd7009547f9b3af6424353 Mon Sep 17 00:00:00 2001 From: Mark Cotton Date: Mon, 11 Sep 2023 22:27:54 -0500 Subject: [PATCH] clean-up and using config to select days of videos to fetch --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 640f73a..e635783 100644 --- a/app.py +++ b/app.py @@ -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: