prevent oldest recording from being deleted

This commit is contained in:
Blake Blackshear 2021-10-15 21:56:03 -05:00
parent 05fc35fc3d
commit b2e05afff2

View File

@ -294,7 +294,8 @@ class RecordingCleanup(threading.Thread):
Recordings.select().order_by(Recordings.start_time.desc()).get()
)
oldest_timestamp = oldest_recording.start_time
p = Path(oldest_recording.path)
oldest_timestamp = p.stat().st_mtime - 1
except DoesNotExist:
oldest_timestamp = datetime.datetime.now().timestamp()