From c5bb962d10364a49992c23f45d22d5326b20607d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:33:19 -0500 Subject: [PATCH] Compare timestamps instead of datetimes when exporting --- frigate/record/export.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frigate/record/export.py b/frigate/record/export.py index 1c47be314d..d3eefc9b25 100644 --- a/frigate/record/export.py +++ b/frigate/record/export.py @@ -72,10 +72,11 @@ def get_datetime_from_timestamp(self, timestamp: int) -> str: def save_thumbnail(self, id: str) -> str: thumb_path = os.path.join(CLIPS_DIR, f"export/{id}.webp") - if datetime.datetime.fromtimestamp( + if ( self.start_time - ) < datetime.datetime.now().astimezone(datetime.timezone.utc).replace( - minute=0, second=0, microsecond=0 + < datetime.datetime.now(datetime.timezone.utc) + .replace(minute=0, second=0, microsecond=0) + .timestamp() ): # has preview mp4 try: