if file has audio/video track flag as type

This commit is contained in:
j 2021-11-14 13:42:06 +00:00
parent 49356d2f7a
commit 65fc082b1b

View file

@ -181,6 +181,11 @@ class File(models.Model):
for type in ox.movie.EXTENSIONS:
if data['extension'] in ox.movie.EXTENSIONS[type]:
data['type'] = type
if data['type'] == 'unknown':
if self.info.get('video'):
data['type'] = 'video'
elif self.info.get('audio'):
data['type'] = 'audio'
if 'part' in data and isinstance(data['part'], int):
data['part'] = str(data['part'])
return data