From 07d5c9c79e589ccac9e62de0e878cb12d07b854f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 2 Nov 2011 15:27:02 +0100 Subject: [PATCH] cleanup dangling clips --- pandora/item/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 0739ae48..e1f41306 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -34,6 +34,7 @@ from data_api import external_data from archive import extract from annotation.models import Annotation +from clip.models import Clip import archive.models from person.models import get_name_sort @@ -1103,6 +1104,8 @@ class Item(models.Model): ) annotation.save() offset += f.duration + #remove left over clips without annotations + Clip.objects.filter(item=self, annotations__id=None).delete() self.update_find() def delete_item(sender, **kwargs):