store objects and motion counts in the db

This commit is contained in:
Blake Blackshear
2021-12-11 13:47:59 -06:00
parent 01e607a14e
commit 188b202836
3 changed files with 51 additions and 0 deletions

View File

@@ -27,3 +27,5 @@ class Recordings(Model):
start_time = DateTimeField()
end_time = DateTimeField()
duration = FloatField()
motion = IntegerField(null=True)
objects = IntegerField(null=True)

View File

@@ -284,6 +284,8 @@ class RecordingMaintainer(threading.Thread):
start_time=start_time.timestamp(),
end_time=end_time.timestamp(),
duration=duration,
motion=motion_count,
objects=active_count,
)
except Exception as e:
logger.error(f"Unable to store recording segment {cache_path}")