Add an optional argument to metadata_published

This commit is contained in:
tcely authored and GitHub committed 2025-02-17 08:19:19 -05:00
1 parent 0a1b08b654
commit 494250625c
1 file changed
+4 -3
+4 -3
View File
@@ -1033,10 +1033,11 @@ class Media(models.Model):
return self.loaded_metadata.get(field, '').strip() return self.loaded_metadata.get(field, '').strip()
@property @property
def metadata_published(self): def metadata_published(self, timestamp=None):
published_dt = None published_dt = None
field = self.get_metadata_field('timestamp') if timestamp is None:
timestamp = self.loaded_metadata.get(field, None) field = self.get_metadata_field('timestamp')
timestamp = self.loaded_metadata.get(field, None)
if timestamp is not None: if timestamp is not None:
try: try:
timestamp_float = float(timestamp) timestamp_float = float(timestamp)