Compare commits

..

3 Commits

Author SHA1 Message Date
Josh Hawkins
ae5f79dcce
Merge c22de09518 into 4171efcd79 2026-04-28 14:45:49 +00:00
Nicolas Mowen
c22de09518 Add confidence default to avoid unnecessary field causing issues 2026-04-28 08:45:23 -06:00
Josh Hawkins
87501ba970 fix invalid recording segment topic being misrouted to the valid handler 2026-04-28 09:07:07 -05:00
2 changed files with 8 additions and 7 deletions

View File

@ -201,9 +201,10 @@ Each line represents a detection state, not necessarily unique individuals. The
except json.JSONDecodeError as je:
logger.error("Failed to parse review description JSON: %s", je)
return None
# observations is required on the model; fill an empty default
# observations and confidence are required on the model; fill an empty default
# if the response omitted it so attribute access stays safe.
raw.setdefault("observations", [])
raw.setdefault("confidence", 0.0)
metadata = ReviewMetadata.model_construct(**raw)
except Exception as e:
logger.error(

View File

@ -317,16 +317,16 @@ class CameraWatchdog(threading.Thread):
if camera != self.config.name:
continue
if topic.endswith(RecordingsDataTypeEnum.valid.value):
self.logger.debug(
f"Latest valid recording segment time on {camera}: {segment_time}"
)
self.latest_valid_segment_time = segment_time
elif topic.endswith(RecordingsDataTypeEnum.invalid.value):
if topic.endswith(RecordingsDataTypeEnum.invalid.value):
self.logger.warning(
f"Invalid recording segment detected for {camera} at {segment_time}"
)
self.latest_invalid_segment_time = segment_time
elif topic.endswith(RecordingsDataTypeEnum.valid.value):
self.logger.debug(
f"Latest valid recording segment time on {camera}: {segment_time}"
)
self.latest_valid_segment_time = segment_time
elif topic.endswith(RecordingsDataTypeEnum.latest.value):
if segment_time is not None:
self.latest_cache_segment_time = segment_time