mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 02:35:22 +03:00
Add other fields
This commit is contained in:
parent
98b154f5ec
commit
b2a8f8330a
@ -3,15 +3,14 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
import time
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from peewee import fn
|
from peewee import fn
|
||||||
|
|
||||||
from frigate.config import EventsConfig, FrigateConfig, RecordConfig
|
from frigate.config import EventsConfig, FrigateConfig
|
||||||
from frigate.const import CLIPS_DIR
|
from frigate.const import CLIPS_DIR
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
from frigate.timeline import InputTypeEnum
|
from frigate.timeline import TimelineSourceEnum
|
||||||
from frigate.types import CameraMetricsTypes
|
from frigate.types import CameraMetricsTypes
|
||||||
|
|
||||||
from multiprocessing.queues import Queue
|
from multiprocessing.queues import Queue
|
||||||
@ -79,7 +78,7 @@ class EventProcessor(threading.Thread):
|
|||||||
self.timeline_queue.put(
|
self.timeline_queue.put(
|
||||||
(
|
(
|
||||||
camera,
|
camera,
|
||||||
InputTypeEnum.tracked_object,
|
TimelineSourceEnum.tracked_object,
|
||||||
event_type,
|
event_type,
|
||||||
self.events_in_process.get(event_data["id"]),
|
self.events_in_process.get(event_data["id"]),
|
||||||
event_data,
|
event_data,
|
||||||
|
|||||||
@ -14,9 +14,9 @@ from multiprocessing.synchronize import Event as MpEvent
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class InputTypeEnum(str, Enum):
|
class TimelineSourceEnum(str, Enum):
|
||||||
|
# api = "api"
|
||||||
# audio = "audio"
|
# audio = "audio"
|
||||||
# external = "external"
|
|
||||||
tracked_object = "tracked_object"
|
tracked_object = "tracked_object"
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class TimelineProcessor(threading.Thread):
|
|||||||
except queue.Empty:
|
except queue.Empty:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if input_type == InputTypeEnum.object:
|
if input_type == TimelineSourceEnum.object:
|
||||||
self.handle_object_detection(
|
self.handle_object_detection(
|
||||||
camera, event_type, prev_event_data, event_data
|
camera, event_type, prev_event_data, event_data
|
||||||
)
|
)
|
||||||
|
|||||||
@ -37,7 +37,7 @@ SQL = pw.SQL
|
|||||||
|
|
||||||
def migrate(migrator, database, fake=False, **kwargs):
|
def migrate(migrator, database, fake=False, **kwargs):
|
||||||
migrator.sql(
|
migrator.sql(
|
||||||
'CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30) NOT NULL, "class_type" VARCHAR(50) NOT NULL, "data" JSON)'
|
'CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30), "class_type" VARCHAR(50) NOT NULL, "data" JSON)'
|
||||||
)
|
)
|
||||||
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")')
|
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")')
|
||||||
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")')
|
migrator.sql('CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user