forked from 0x2620/pandora
if info has duration of 0 or less use duratino from extracted streams (work around issues in upload process)
This commit is contained in:
parent
0151b282a2
commit
90a7488797
1 changed files with 2 additions and 0 deletions
|
@ -453,6 +453,8 @@ class Stream(models.Model):
|
|||
self.info = ox.avinfo(self.video.path)
|
||||
self.oshash = self.info.get('oshash')
|
||||
self.duration = self.info.get('duration', 0)
|
||||
if self.duration <= 0:
|
||||
self.duration = sum([s.info['duration'] for s in self.streams.filter(source=None)])
|
||||
if 'video' in self.info and self.info['video']:
|
||||
self.aspect_ratio = self.info['video'][0]['width'] / self.info['video'][0]['height']
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue