Merge pull request #868 from tcely/patch-12
Some checks are pending
Run Django tests for TubeSync / test (3.10) (push) Waiting to run
Run Django tests for TubeSync / test (3.11) (push) Waiting to run
Run Django tests for TubeSync / test (3.12) (push) Waiting to run
Run Django tests for TubeSync / test (3.8) (push) Waiting to run
Run Django tests for TubeSync / test (3.9) (push) Waiting to run
Run Django tests for TubeSync / containerise (push) Blocked by required conditions

Use `Media.metadata_published` in `reduce_data`
This commit is contained in:
meeb 2025-03-20 02:17:06 +11:00 committed by GitHub
commit f0ec22221e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1084,7 +1084,8 @@ class Media(models.Model):
data = json.loads(self.metadata or "{}") data = json.loads(self.metadata or "{}")
if '_reduce_data_ran_at' in data.keys(): if '_reduce_data_ran_at' in data.keys():
total_seconds = data['_reduce_data_ran_at'] total_seconds = data['_reduce_data_ran_at']
ran_at = self.posix_epoch + timedelta(seconds=total_seconds) assert isinstance(total_seconds, int), type(total_seconds)
ran_at = self.metadata_published(total_seconds)
if (now - ran_at) < timedelta(hours=1): if (now - ran_at) < timedelta(hours=1):
return data return data