mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Formatting
This commit is contained in:
parent
476e727f5d
commit
c5aa12d73d
@ -1023,7 +1023,10 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
|
|
||||||
# If there are required zones and there is no overlap
|
# If there are required zones and there is no overlap
|
||||||
review_config = self.config.cameras[camera].review
|
review_config = self.config.cameras[camera].review
|
||||||
required_zones = review_config.alerts.required_zones + review_config.detections.required_zones
|
required_zones = (
|
||||||
|
review_config.alerts.required_zones
|
||||||
|
+ review_config.detections.required_zones
|
||||||
|
)
|
||||||
if len(required_zones) > 0 and not set(obj.entered_zones) & set(required_zones):
|
if len(required_zones) > 0 and not set(obj.entered_zones) & set(required_zones):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Not creating clip for {obj.obj_data['id']} because it did not enter required zones"
|
f"Not creating clip for {obj.obj_data['id']} because it did not enter required zones"
|
||||||
|
|||||||
@ -12,6 +12,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
CURRENT_CONFIG_VERSION = 0.14
|
CURRENT_CONFIG_VERSION = 0.14
|
||||||
|
|
||||||
|
|
||||||
def migrate_frigate_config(config_file: str):
|
def migrate_frigate_config(config_file: str):
|
||||||
"""handle migrating the frigate config."""
|
"""handle migrating the frigate config."""
|
||||||
logger.info("Checking if frigate config needs migration...")
|
logger.info("Checking if frigate config needs migration...")
|
||||||
@ -55,7 +56,9 @@ def migrate_014(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any]]:
|
|||||||
"""Handle migrating frigate config to 0.14"""
|
"""Handle migrating frigate config to 0.14"""
|
||||||
# migrate record.events.required_zones to review.alerts.required_zones
|
# migrate record.events.required_zones to review.alerts.required_zones
|
||||||
new_config = config.copy()
|
new_config = config.copy()
|
||||||
global_required_zones = config.get("record", {}).get("events", {}).get("required_zones", [])
|
global_required_zones = (
|
||||||
|
config.get("record", {}).get("events", {}).get("required_zones", [])
|
||||||
|
)
|
||||||
|
|
||||||
if global_required_zones:
|
if global_required_zones:
|
||||||
if not new_config.get("review"):
|
if not new_config.get("review"):
|
||||||
@ -77,7 +80,9 @@ def migrate_014(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any]]:
|
|||||||
|
|
||||||
for name, camera in config.get("cameras", {}).items():
|
for name, camera in config.get("cameras", {}).items():
|
||||||
camera_config: dict[str, dict[str, any]] = camera.copy()
|
camera_config: dict[str, dict[str, any]] = camera.copy()
|
||||||
required_zones = camera_config.get("record", {}).get("events", {}).get("required_zones", [])
|
required_zones = (
|
||||||
|
camera_config.get("record", {}).get("events", {}).get("required_zones", [])
|
||||||
|
)
|
||||||
|
|
||||||
if required_zones:
|
if required_zones:
|
||||||
if not camera_config.get("review"):
|
if not camera_config.get("review"):
|
||||||
@ -100,6 +105,3 @@ def migrate_014(config: dict[str, dict[str, any]]) -> dict[str, dict[str, any]]:
|
|||||||
new_config["cameras"][name] = camera_config
|
new_config["cameras"][name] = camera_config
|
||||||
|
|
||||||
return new_config
|
return new_config
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user