From 42486c885e2e1cc7323f380b7c6d49bc6e9e4fe1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 9 Mar 2012 19:27:28 +0100 Subject: [PATCH] dont update sort/find while import subtitles --- pandora/annotation/models.py | 3 --- pandora/annotation/views.py | 4 +++- pandora/item/management/commands/update_external.py | 6 +----- pandora/item/models.py | 1 - pandora/item/tasks.py | 3 +++ 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 3b572cb8..45e91dfd 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -161,9 +161,6 @@ class Annotation(models.Model): if layer.get('type') == 'event' or layer.get('hasEvents'): update_matching_events(self.id) - #update sort/find tables async - update_item.delay(self.id) - def delete(self, *args, **kwargs): super(Annotation, self).delete(*args, **kwargs) if self.clip.annotations.count() == 0: diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index a59d800e..38dfba12 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -17,7 +17,7 @@ from item import utils from item.models import Item import models - +from tasks import update_item def parse_query(data, user): query = {} @@ -200,6 +200,8 @@ def editAnnotation(request): 'out': 'end' }.get(key,key), data[key]) a.save() + #update sort/find tables async + update_item.delay(a.id) response['data'] = a.json() response['data']['editable'] = True else: diff --git a/pandora/item/management/commands/update_external.py b/pandora/item/management/commands/update_external.py index 04070ebb..b68b3790 100644 --- a/pandora/item/management/commands/update_external.py +++ b/pandora/item/management/commands/update_external.py @@ -2,11 +2,7 @@ # vi:si:et:sw=4:sts=4:ts=4 from optparse import make_option -import os -from os.path import join, dirname, basename, splitext, exists - -from django.core.management.base import BaseCommand, CommandError -from django.conf import settings +from django.core.management.base import BaseCommand import monkey_patch.models from ... import models diff --git a/pandora/item/models.py b/pandora/item/models.py index 27a13c98..e2f44df8 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1255,7 +1255,6 @@ class Item(models.Model): offset += f.duration #remove left over clips without annotations Clip.objects.filter(item=self, annotations__id=None).delete() - self.update_find() def srt(self, layer): return ox.srt.encode([{ diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index 02fabd44..273d24cd 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -59,6 +59,9 @@ def update_timeline(itemId): def load_subtitles(itemId): item = models.Item.objects.get(itemId=itemId) item.load_subtitles() + item.update_find() + item.update_sort() + item.update_facets() @task(ignore_resulsts=True, queue='default') def update_sitemap(base_url):