mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 21:17:43 +03:00
backend fixes
This commit is contained in:
parent
64851aeb54
commit
4c12420cf8
@ -27,6 +27,7 @@ def should_update_db(prev_event: Event, current_event: Event) -> bool:
|
||||
or prev_event["average_estimated_speed"]
|
||||
!= current_event["average_estimated_speed"]
|
||||
or prev_event["velocity_angle"] != current_event["velocity_angle"]
|
||||
or prev_event["identifier"] != current_event["identifier"]
|
||||
or prev_event["path_data"] != current_event["path_data"]
|
||||
):
|
||||
return True
|
||||
@ -226,6 +227,11 @@ class EventProcessor(threading.Thread):
|
||||
event[Event.sub_label] = event_data["sub_label"][0]
|
||||
event[Event.data]["sub_label_score"] = event_data["sub_label"][1]
|
||||
|
||||
# only overwrite the identifier in the database if it's set
|
||||
if event_data.get("identifier") is not None:
|
||||
event[Event.data]["identifier"] = event_data["identifier"][0]
|
||||
event[Event.data]["identifier_score"] = event_data["identifier"][1]
|
||||
|
||||
(
|
||||
Event.insert(event)
|
||||
.on_conflict(
|
||||
|
||||
@ -153,6 +153,8 @@ class TrackedObject:
|
||||
"current_estimated_speed": self.current_estimated_speed,
|
||||
"velocity_angle": self.velocity_angle,
|
||||
"path_data": self.path_data,
|
||||
"identifier": obj_data.get("identifier"),
|
||||
"identifier_score": obj_data.get("identifier_score"),
|
||||
}
|
||||
thumb_update = True
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user