Fix frigate+ uploading bug

Fixes https://github.com/blakeblackshear/frigate/issues/5515
This commit is contained in:
Nicolas Mowen 2023-02-16 16:27:06 -07:00 committed by GitHub
parent 52459bf348
commit 4116c3bb4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,6 +183,15 @@ def send_to_plus(id):
message = f"Event {id} not found" message = f"Event {id} not found"
logger.error(message) logger.error(message)
return make_response(jsonify({"success": False, "message": message}), 404) 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: if event.plus_id:
message = "Already submitted to plus" message = "Already submitted to plus"
@ -201,6 +210,15 @@ def send_to_plus(id):
), ),
400, 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: try:
plus_id = current_app.plus_api.upload_image(image, event.camera) plus_id = current_app.plus_api.upload_image(image, event.camera)