fix default clips, should be full minute + 5, fixes #45

This commit is contained in:
j 2011-10-27 11:42:03 +02:00
parent 4aab40797d
commit 8313095e53

View file

@ -3,6 +3,7 @@
from __future__ import division, with_statement from __future__ import division, with_statement
from datetime import datetime from datetime import datetime
import math
import os.path import os.path
import re import re
import subprocess import subprocess
@ -1083,8 +1084,7 @@ class Item(models.Model):
annotation.save() annotation.save()
#otherwise add empty 5 seconds annotation every minute #otherwise add empty 5 seconds annotation every minute
if not subtitles_added: if not subtitles_added:
i = offset for i in range(int(math.ceil(offset)), int(offset + f.duration) - 5, 60):
while i < offset + f.duration - 5:
annotation = Annotation( annotation = Annotation(
item=self, item=self,
layer=layer, layer=layer,
@ -1094,7 +1094,6 @@ class Item(models.Model):
user=user user=user
) )
annotation.save() annotation.save()
i += 60
offset += f.duration offset += f.duration
self.update_find() self.update_find()