mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 19:55:26 +03:00
fix update logic
This commit is contained in:
parent
338a635056
commit
cd812654b0
@ -63,12 +63,10 @@ class GeminiProcessor(threading.Thread):
|
|||||||
)
|
)
|
||||||
|
|
||||||
sub_label = response.text.strip()
|
sub_label = response.text.strip()
|
||||||
Event.update(sub_label=sub_label).where(
|
event = Event.get(Event.id == event_data["id"])
|
||||||
Event.id == event_data["id"]
|
if camera_config.gemini.override_existing or not event.sub_label:
|
||||||
and (
|
event.sub_label = sub_label
|
||||||
camera_config.gemini.override_existing or Event.sub_label.is_null()
|
event.save()
|
||||||
)
|
|
||||||
).execute()
|
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Generated sub label for %s on %s in %.4f seconds: %s",
|
"Generated sub label for %s on %s in %.4f seconds: %s",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user