From e207b2f50bd116ee014e3779ac7e6a2b9d353b1b Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 10 Feb 2025 09:30:23 -0600 Subject: [PATCH] Refactor export filenames to include start and end date/time (#16446) --- frigate/record/export.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frigate/record/export.py b/frigate/record/export.py index e083d9208..48fe20e83 100644 --- a/frigate/record/export.py +++ b/frigate/record/export.py @@ -333,7 +333,14 @@ class RecordingExporter(threading.Thread): self.user_provided_name or f"{self.camera.replace('_', ' ')} {self.get_datetime_from_timestamp(self.start_time)} {self.get_datetime_from_timestamp(self.end_time)}" ) - video_path = f"{EXPORT_DIR}/{self.export_id}.mp4" + filename_start_datetime = datetime.datetime.fromtimestamp( + self.start_time + ).strftime("%Y%m%d_%H%M%S") + filename_end_datetime = datetime.datetime.fromtimestamp(self.end_time).strftime( + "%Y%m%d_%H%M%S" + ) + cleaned_export_id = self.export_id.split("_")[-1] + video_path = f"{EXPORT_DIR}/{self.camera}_{filename_start_datetime}-{filename_end_datetime}_{cleaned_export_id}.mp4" thumb_path = self.save_thumbnail(self.export_id) Export.insert(