Add an optional argument to metadata_published
This commit is contained in:
1 parent
0a1b08b654
commit
494250625c
1 file changed
+4
-3
@@ -1033,10 +1033,11 @@ class Media(models.Model):
|
||||
return self.loaded_metadata.get(field, '').strip()
|
||||
|
||||
@property
|
||||
def metadata_published(self):
|
||||
def metadata_published(self, timestamp=None):
|
||||
published_dt = None
|
||||
field = self.get_metadata_field('timestamp')
|
||||
timestamp = self.loaded_metadata.get(field, None)
|
||||
if timestamp is None:
|
||||
field = self.get_metadata_field('timestamp')
|
||||
timestamp = self.loaded_metadata.get(field, None)
|
||||
if timestamp is not None:
|
||||
try:
|
||||
timestamp_float = float(timestamp)
|
||||
|
||||
Reference in new issue
Block a user