From 1ad90ad62886ff472dc79e9b678ead913419f92b Mon Sep 17 00:00:00 2001 From: tcely Date: Mon, 24 Feb 2025 10:11:06 -0500 Subject: [PATCH] Access `posix_epoch` correctly Fixes #768 --- tubesync/sync/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 86aa4e10..a1e2846d 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -1018,7 +1018,7 @@ class Media(models.Model): data = json.loads(self.metadata or "{}") if '_reduce_data_ran_at' in data.keys(): total_seconds = data['_reduce_data_ran_at'] - ran_at = posix_epoch + timedelta(seconds=total_seconds) + ran_at = self.posix_epoch + timedelta(seconds=total_seconds) if (timezone.now() - ran_at) < timedelta(hours=1): return data @@ -1132,7 +1132,7 @@ class Media(models.Model): if timestamp is not None: try: timestamp_float = float(timestamp) - published_dt = posix_epoch + timedelta(seconds=timestamp_float) + published_dt = self.posix_epoch + timedelta(seconds=timestamp_float) except Exception as e: log.warn(f'Could not compute published from timestamp for: {self.source} / {self} with "{e}"') return published_dt