From 8313095e532f981af2ae05950c0904c74a5fb1ea Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 27 Oct 2011 11:42:03 +0200 Subject: [PATCH] fix default clips, should be full minute + 5, fixes #45 --- pandora/item/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 0d1e0e0b..49612940 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -3,6 +3,7 @@ from __future__ import division, with_statement from datetime import datetime +import math import os.path import re import subprocess @@ -1083,8 +1084,7 @@ class Item(models.Model): annotation.save() #otherwise add empty 5 seconds annotation every minute if not subtitles_added: - i = offset - while i < offset + f.duration - 5: + for i in range(int(math.ceil(offset)), int(offset + f.duration) - 5, 60): annotation = Annotation( item=self, layer=layer, @@ -1094,7 +1094,6 @@ class Item(models.Model): user=user ) annotation.save() - i += 60 offset += f.duration self.update_find()