mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Only include segments that have a nonzero size
This commit is contained in:
parent
573c840ec6
commit
3af9929e1d
@ -36,7 +36,9 @@ class StorageMaintainer(threading.Thread):
|
||||
self.camera_storage_stats[camera] = {
|
||||
"needs_refresh": (
|
||||
Recordings.select(fn.COUNT(Recordings.id))
|
||||
.where(Recordings.camera == camera)
|
||||
.where(
|
||||
Recordings.camera == camera, Recordings.segment_size != 0
|
||||
)
|
||||
.scalar()
|
||||
< 50
|
||||
)
|
||||
@ -45,7 +47,7 @@ class StorageMaintainer(threading.Thread):
|
||||
# calculate MB/hr
|
||||
bandwidth = round(
|
||||
Recordings.select(fn.AVG(bandwidth_equation))
|
||||
.where(Recordings.camera == camera)
|
||||
.where(Recordings.camera == camera, Recordings.segment_size != 0)
|
||||
.limit(100)
|
||||
.scalar()
|
||||
* 3600,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user