From 19a56af125c0cfbb5ee380a8f9b86e4bcf05bb18 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 27 May 2012 15:16:07 +0000 Subject: [PATCH] only cleanup clips related to item, gets to slow with many annotations --- pandora/annotation/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/annotation/tasks.py b/pandora/annotation/tasks.py index 84fa5659..4684ad86 100644 --- a/pandora/annotation/tasks.py +++ b/pandora/annotation/tasks.py @@ -69,7 +69,7 @@ def update_item(id): from clip.models import Clip a = models.Annotation.objects.get(pk=id) #cleanup orphaned clips - Clip.objects.filter(annotations__id=None).delete() + Clip.objects.filter(item__id=a.item.id, annotations__id=None).delete() #update facets if needed if filter(lambda f: f['id'] == a.layer, settings.CONFIG['filters']): a.item.update_layer_facet(a.layer)