mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35: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] = {
|
self.camera_storage_stats[camera] = {
|
||||||
"needs_refresh": (
|
"needs_refresh": (
|
||||||
Recordings.select(fn.COUNT(Recordings.id))
|
Recordings.select(fn.COUNT(Recordings.id))
|
||||||
.where(Recordings.camera == camera)
|
.where(
|
||||||
|
Recordings.camera == camera, Recordings.segment_size != 0
|
||||||
|
)
|
||||||
.scalar()
|
.scalar()
|
||||||
< 50
|
< 50
|
||||||
)
|
)
|
||||||
@ -45,7 +47,7 @@ class StorageMaintainer(threading.Thread):
|
|||||||
# calculate MB/hr
|
# calculate MB/hr
|
||||||
bandwidth = round(
|
bandwidth = round(
|
||||||
Recordings.select(fn.AVG(bandwidth_equation))
|
Recordings.select(fn.AVG(bandwidth_equation))
|
||||||
.where(Recordings.camera == camera)
|
.where(Recordings.camera == camera, Recordings.segment_size != 0)
|
||||||
.limit(100)
|
.limit(100)
|
||||||
.scalar()
|
.scalar()
|
||||||
* 3600,
|
* 3600,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user