mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Don't expect event to be valid
This commit is contained in:
parent
22e259b0ce
commit
f1b7794a8e
@ -28,7 +28,7 @@ from playhouse.shortcuts import model_to_dict
|
|||||||
|
|
||||||
from frigate.const import CLIPS_DIR
|
from frigate.const import CLIPS_DIR
|
||||||
from frigate.models import Event, Recordings
|
from frigate.models import Event, Recordings
|
||||||
from frigate.object_processing import TrackedObjectProcessor
|
from frigate.object_processing import TrackedObject, TrackedObjectProcessor
|
||||||
from frigate.stats import stats_snapshot
|
from frigate.stats import stats_snapshot
|
||||||
from frigate.version import VERSION
|
from frigate.version import VERSION
|
||||||
|
|
||||||
@ -236,9 +236,14 @@ def set_sub_label(id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not event.end_time:
|
if not event.end_time:
|
||||||
current_app.detected_frames_processor.camera_states[
|
tracked_obj: TrackedObject = (
|
||||||
event.camera
|
current_app.detected_frames_processor.camera_states[event.camera].get(
|
||||||
].tracked_objects[event.id].obj_data["sub_label"] = new_sub_label
|
event.id
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if tracked_obj:
|
||||||
|
tracked_obj.obj_data["sub_label"] = new_sub_label
|
||||||
|
|
||||||
event.sub_label = new_sub_label
|
event.sub_label = new_sub_label
|
||||||
event.save()
|
event.save()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user