Formatting

This commit is contained in:
Nick Mowen 2022-09-25 09:40:04 -06:00
parent c3387effe0
commit 384595f5e6
3 changed files with 8 additions and 6 deletions

View File

@ -306,9 +306,7 @@ class FrigateApp:
self.recording_cleanup.start()
def start_storage_maintainer(self) -> None:
self.storage_maintainer = StorageMaintainer(
self.config, self.stop_event
)
self.storage_maintainer = StorageMaintainer(self.config, self.stop_event)
self.storage_maintainer.start()
def start_stats_emitter(self) -> None:

View File

@ -41,4 +41,4 @@ class Recordings(Model): # type: ignore[misc]
duration = FloatField()
motion = IntegerField(null=True)
objects = IntegerField(null=True)
segment_size = FloatField(default=0) # this should be stored as MB
segment_size = FloatField(default=0) # this should be stored as MB

View File

@ -34,10 +34,14 @@ class StorageMaintainer(threading.Thread):
.scalar(),
2,
)
segment_duration = int(Recordings.select(Recordings.duration).where(Recordings.camera == camera).scalar())
segment_duration = int(
Recordings.select(Recordings.duration)
.where(Recordings.camera == camera)
.scalar()
)
self.avg_segment_sizes[camera] = {
"segment": avg_segment_size,
"hour": (3600 / segment_duration) * avg_segment_size
"hour": (3600 / segment_duration) * avg_segment_size,
}
def run(self):