dont update sort/find while import subtitles

This commit is contained in:
j 2012-03-09 19:27:28 +01:00
parent 50ad006359
commit 42486c885e
5 changed files with 7 additions and 10 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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([{

View File

@ -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):