Refactor event cleanup to consider review severity (#15415)

* Keep track of objects max review severity

* Refactor cleanup to split snapshots and clips

* Cleanup events based on review severity

* Cleanup review imports

* Don't catch detections
This commit is contained in:
Nicolas Mowen
2024-12-09 08:25:45 -07:00
committed by GitHub
parent d0cc8cb64b
commit 0b9c4c18dd
11 changed files with 187 additions and 84 deletions
+1 -6
View File
@@ -7,7 +7,6 @@ import random
import string
import sys
import threading
from enum import Enum
from multiprocessing.synchronize import Event as MpEvent
from pathlib import Path
from typing import Optional
@@ -27,6 +26,7 @@ from frigate.const import (
from frigate.events.external import ManualEventState
from frigate.models import ReviewSegment
from frigate.object_processing import TrackedObject
from frigate.review.types import SeverityEnum
from frigate.util.image import SharedMemoryFrameManager, calculate_16_9_crop
logger = logging.getLogger(__name__)
@@ -39,11 +39,6 @@ THRESHOLD_ALERT_ACTIVITY = 120
THRESHOLD_DETECTION_ACTIVITY = 30
class SeverityEnum(str, Enum):
alert = "alert"
detection = "detection"
class PendingReviewSegment:
def __init__(
self,