From a1f5a996ae561c9f8360b86c3eba36cab9aa3f80 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 12 Oct 2022 19:07:08 -0400 Subject: [PATCH] Minor changes and fixes. --- app/models/event_device_models.py | 6 +++--- app/routers/event_device.py | 2 +- app/routers/event_file.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/models/event_device_models.py b/app/models/event_device_models.py index f35dc27..3615145 100644 --- a/app/models/event_device_models.py +++ b/app/models/event_device_models.py @@ -44,11 +44,11 @@ class Event_Device_Base(BaseModel): api_secret_key: Optional[str] - api_server_base_url: Optional[str] + api_base_url: Optional[str] app_server_base_url: Optional[str] file_server_base_url: Optional[str] - api_server_base_url_bak: Optional[str] # Backup URL + api_base_url_bak: Optional[str] # Backup URL app_server_base_url_bak: Optional[str] # Backup URL file_server_base_url_bak: Optional[str] # Backup URL @@ -71,7 +71,7 @@ class Event_Device_Base(BaseModel): trigger_show_admin: Optional[str] trigger_show_hidden: Optional[str] - host_file_cache_path: Optional[str] # Path for hash file cache only + local_file_cache_path: Optional[str] # Path for hash file cache only host_file_temp_path: Optional[str] # Path for copied and renamed temporary files from hash file cache directory recording_path: Optional[str] # Path to save recordings diff --git a/app/routers/event_device.py b/app/routers/event_device.py index 329c0b8..20dce4b 100644 --- a/app/routers/event_device.py +++ b/app/routers/event_device.py @@ -141,7 +141,7 @@ async def get_event_device_obj( commons: Common_Route_Params = Depends(common_route_params), ): - log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL + log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL log.debug(locals()) # ### SECTION ### Secondary data validation diff --git a/app/routers/event_file.py b/app/routers/event_file.py index 19be08b..a18bf64 100644 --- a/app/routers/event_file.py +++ b/app/routers/event_file.py @@ -279,10 +279,11 @@ async def download_event_file( log.info(f'Full file path with subdirectory: {file_path_w_subdir}') if os.path.exists(file_path_w_subdir): + log.info('Hosted file found on server.') return FileResponse(file_path_w_subdir, filename=filename) else: log.error(f'The hosted file was not found on the server. Hash: {hash_sha256}') - return mk_resp(data=False, status_code=400, response=commons.response, status_message='The hosted file was not found on the server.') # Bad Request + return mk_resp(data=False, status_code=404, response=commons.response, status_message=f'The hosted file was not found on the server. Hash: {hash_sha256}') # Not Found # ### END ### API Event File ### download_event_file() ###