From 1dbe02cbd0386273a346fa87babadd288d708ac1 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 26 Sep 2022 16:31:57 -0600 Subject: [PATCH] Get size of file from cache --- frigate/record.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frigate/record.py b/frigate/record.py index 05ef2145f..e7c3c2049 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -285,10 +285,12 @@ class RecordingMaintainer(threading.Thread): ) try: - segment_size = round(float(os.path.getsize(file_path)) / 1000000, 1) + segment_size = round(float(os.path.getsize(cache_path)) / 1000000, 1) except OSError: segment_size = 0 + os.remove(cache_path) + rand_id = "".join( random.choices(string.ascii_lowercase + string.digits, k=6) )