check that duration is no 0
This commit is contained in:
parent
a15a8d8ded
commit
9b4c87b867
1 changed files with 4 additions and 1 deletions
|
@ -649,7 +649,10 @@ class Item(models.Model):
|
||||||
s.numberoffiles = self.files.all().count()
|
s.numberoffiles = self.files.all().count()
|
||||||
s.parts = videos.count()
|
s.parts = videos.count()
|
||||||
s.size = sum([v.size for v in videos]) #FIXME: only size of movies?
|
s.size = sum([v.size for v in videos]) #FIXME: only size of movies?
|
||||||
s.bitrate = s.size * 8 / s.duration
|
if s.duration:
|
||||||
|
s.bitrate = s.size * 8 / s.duration
|
||||||
|
else:
|
||||||
|
s.bitrate = 0
|
||||||
s.volume = 0
|
s.volume = 0
|
||||||
else:
|
else:
|
||||||
s.duration = None
|
s.duration = None
|
||||||
|
|
Loading…
Reference in a new issue