mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix hardcoded camera name (#13520)
* Fix hardcoded camera name * Simplify logic
This commit is contained in:
parent
e66f47bdf6
commit
58a471e466
@ -5,11 +5,9 @@ import itertools
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
from functools import reduce
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
from pathlib import Path
|
||||
|
||||
from peewee import operator
|
||||
from playhouse.sqlite_ext import SqliteExtDatabase
|
||||
|
||||
from frigate.config import CameraConfig, FrigateConfig, RetainModeEnum
|
||||
@ -73,26 +71,17 @@ class RecordingCleanup(threading.Thread):
|
||||
).timestamp()
|
||||
expired_reviews: ReviewSegment = (
|
||||
ReviewSegment.select(ReviewSegment.id)
|
||||
.where(ReviewSegment.camera == "front_cam")
|
||||
.where(ReviewSegment.camera == config.name)
|
||||
.where(
|
||||
reduce(
|
||||
operator.or_,
|
||||
[
|
||||
reduce(
|
||||
operator.and_,
|
||||
[
|
||||
(ReviewSegment.severity == "alert"),
|
||||
(ReviewSegment.end_time < alert_expire_date),
|
||||
],
|
||||
),
|
||||
reduce(
|
||||
operator.and_,
|
||||
[
|
||||
(ReviewSegment.severity == "detection"),
|
||||
(ReviewSegment.end_time < detection_expire_date),
|
||||
],
|
||||
),
|
||||
],
|
||||
(
|
||||
ReviewSegment.severity
|
||||
== "alert" & ReviewSegment.end_time
|
||||
< alert_expire_date
|
||||
)
|
||||
| (
|
||||
ReviewSegment.severity
|
||||
== "detection" & ReviewSegment.end_time
|
||||
< detection_expire_date
|
||||
)
|
||||
)
|
||||
.namedtuples()
|
||||
|
Loading…
Reference in New Issue
Block a user