use duration of files while we dont have streams, fixes #1208
This commit is contained in:
parent
c576e347a8
commit
d63e5cba32
1 changed files with 4 additions and 0 deletions
|
@ -544,6 +544,10 @@ class Item(models.Model):
|
|||
streams = self.streams()
|
||||
i['durations'] = [s.duration for s in streams]
|
||||
i['duration'] = sum(i['durations'])
|
||||
if not streams:
|
||||
i['duration'] = self.files.filter(
|
||||
Q(selected=True)|Q(wanted=True)
|
||||
).aggregate(Sum('duration'))['duration__sum']
|
||||
i['parts'] = len(i['durations'])
|
||||
if i['parts']:
|
||||
i['videoRatio'] = streams[0].aspect_ratio
|
||||
|
|
Loading…
Reference in a new issue