duration is stream duration not source video duration

This commit is contained in:
j 2013-09-06 11:59:33 +02:00
parent 954c68994e
commit 5df00a3c91

View file

@ -831,7 +831,8 @@ class Item(models.Model):
s.numberoffiles = self.files.all().count() s.numberoffiles = self.files.all().count()
videos = self.files.filter(selected=True).filter(Q(is_video=True)|Q(is_audio=True)) videos = self.files.filter(selected=True).filter(Q(is_video=True)|Q(is_audio=True))
if videos.count() > 0: if videos.count() > 0:
s.duration = sum([v.duration for v in videos]) #s.duration = sum([v.duration for v in videos])
s.duration = sum([s.duration for s in self.streams()])
v = videos[0] v = videos[0]
if v.is_audio: if v.is_audio:
s.resolution = None s.resolution = None