mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Fix return Any from return statement
Not all elements from the event dict are sure to be something that can be evaluated See e.g.: https://github.com/python/mypy/issues/5697
This commit is contained in:
parent
db55e59c2c
commit
6929db0b1c
@ -28,13 +28,16 @@ def should_insert_db(prev_event: Event, current_event: Event) -> bool:
|
|||||||
|
|
||||||
def should_update_db(prev_event: Event, current_event: Event) -> bool:
|
def should_update_db(prev_event: Event, current_event: Event) -> bool:
|
||||||
"""If current_event has updated fields and (clip or snapshot)."""
|
"""If current_event has updated fields and (clip or snapshot)."""
|
||||||
return (current_event["has_clip"] or current_event["has_snapshot"]) and (
|
if current_event["has_clip"] or current_event["has_snapshot"]:
|
||||||
prev_event["top_score"] != current_event["top_score"]
|
if (
|
||||||
or prev_event["entered_zones"] != current_event["entered_zones"]
|
prev_event["top_score"] != current_event["top_score"]
|
||||||
or prev_event["thumbnail"] != current_event["thumbnail"]
|
or prev_event["entered_zones"] != current_event["entered_zones"]
|
||||||
or prev_event["has_clip"] != current_event["has_clip"]
|
or prev_event["thumbnail"] != current_event["thumbnail"]
|
||||||
or prev_event["has_snapshot"] != current_event["has_snapshot"]
|
or prev_event["has_clip"] != current_event["has_clip"]
|
||||||
)
|
or prev_event["has_snapshot"] != current_event["has_snapshot"]
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
class EventProcessor(threading.Thread):
|
class EventProcessor(threading.Thread):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user