diff --git a/frigate/app.py b/frigate/app.py index 29a19f893..b97f580a0 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -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: diff --git a/frigate/models.py b/frigate/models.py index 16d16336f..4facf4bfa 100644 --- a/frigate/models.py +++ b/frigate/models.py @@ -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 diff --git a/frigate/storage.py b/frigate/storage.py index 00ba5bf9a..2011096d7 100644 --- a/frigate/storage.py +++ b/frigate/storage.py @@ -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):