fix tests

This commit is contained in:
meeb 2022-02-15 17:44:13 +11:00
parent 61cd63bcc1
commit 367d41f2be
1 changed files with 3 additions and 1 deletions

View File

@ -1000,7 +1000,9 @@ class Media(models.Model):
def duration(self):
field = self.get_metadata_field('duration')
duration = self.loaded_metadata.get(field, 0)
if not isinstance(duration, int):
try:
duration = int(duration)
except ValueError:
duration = 0
return duration