Fix always the same image is sent to GenAI (#15550)

* Fix always the same image is sent to GenAI

* Fix typo for bug where identical images are sent to GenAI

* Correct formatting
This commit is contained in:
Giorgio Ughini 2024-12-17 14:44:00 +01:00 committed by GitHub
parent 292499aebc
commit d9ef8fa206
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,7 +221,10 @@ class EmbeddingMaintainer(threading.Thread):
[snapshot_image] [snapshot_image]
if event.has_snapshot and camera_config.genai.use_snapshot if event.has_snapshot and camera_config.genai.use_snapshot
else ( else (
[thumbnail for data in self.tracked_events[event_id]] [
data["thumbnail"]
for data in self.tracked_events[event_id]
]
if len(self.tracked_events.get(event_id, [])) > 0 if len(self.tracked_events.get(event_id, [])) > 0
else [thumbnail] else [thumbnail]
) )
@ -357,7 +360,7 @@ class EmbeddingMaintainer(threading.Thread):
[snapshot_image] [snapshot_image]
if event.has_snapshot and source == "snapshot" if event.has_snapshot and source == "snapshot"
else ( else (
[thumbnail for data in self.tracked_events[event_id]] [data["thumbnail"] for data in self.tracked_events[event_id]]
if len(self.tracked_events.get(event_id, [])) > 0 if len(self.tracked_events.get(event_id, [])) > 0
else [thumbnail] else [thumbnail]
) )