From 4116c3bb4ccbddd5e8f588b4854a7090349679b6 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 16 Feb 2023 16:27:06 -0700 Subject: [PATCH] Fix frigate+ uploading bug Fixes https://github.com/blakeblackshear/frigate/issues/5515 --- frigate/http.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index 4ae4d4d95..a5c2b7439 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -183,6 +183,15 @@ def send_to_plus(id): message = f"Event {id} not found" logger.error(message) return make_response(jsonify({"success": False, "message": message}), 404) + + if event.end_time is None: + logger.error(f"Unable to load clean snapshot for in-progress event: {event.id}") + return make_response( + jsonify( + {"success": False, "message": "Unable to load clean png for in-progress event"} + ), + 400, + ) if event.plus_id: message = "Already submitted to plus" @@ -201,6 +210,15 @@ def send_to_plus(id): ), 400, ) + + if image is None or image.size == 0: + logger.error(f"Unable to load clean png for event: {event.id}") + return make_response( + jsonify( + {"success": False, "message": "Unable to load clean png for event"} + ), + 400, + ) try: plus_id = current_app.plus_api.upload_image(image, event.camera)