dont update sort/find while import subtitles
This commit is contained in:
parent
50ad006359
commit
42486c885e
5 changed files with 7 additions and 10 deletions
|
@ -161,9 +161,6 @@ class Annotation(models.Model):
|
||||||
if layer.get('type') == 'event' or layer.get('hasEvents'):
|
if layer.get('type') == 'event' or layer.get('hasEvents'):
|
||||||
update_matching_events(self.id)
|
update_matching_events(self.id)
|
||||||
|
|
||||||
#update sort/find tables async
|
|
||||||
update_item.delay(self.id)
|
|
||||||
|
|
||||||
def delete(self, *args, **kwargs):
|
def delete(self, *args, **kwargs):
|
||||||
super(Annotation, self).delete(*args, **kwargs)
|
super(Annotation, self).delete(*args, **kwargs)
|
||||||
if self.clip.annotations.count() == 0:
|
if self.clip.annotations.count() == 0:
|
||||||
|
|
|
@ -17,7 +17,7 @@ from item import utils
|
||||||
from item.models import Item
|
from item.models import Item
|
||||||
|
|
||||||
import models
|
import models
|
||||||
|
from tasks import update_item
|
||||||
|
|
||||||
def parse_query(data, user):
|
def parse_query(data, user):
|
||||||
query = {}
|
query = {}
|
||||||
|
@ -200,6 +200,8 @@ def editAnnotation(request):
|
||||||
'out': 'end'
|
'out': 'end'
|
||||||
}.get(key,key), data[key])
|
}.get(key,key), data[key])
|
||||||
a.save()
|
a.save()
|
||||||
|
#update sort/find tables async
|
||||||
|
update_item.delay(a.id)
|
||||||
response['data'] = a.json()
|
response['data'] = a.json()
|
||||||
response['data']['editable'] = True
|
response['data']['editable'] = True
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -2,11 +2,7 @@
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
from optparse import make_option
|
from optparse import make_option
|
||||||
|
|
||||||
import os
|
from django.core.management.base import BaseCommand
|
||||||
from os.path import join, dirname, basename, splitext, exists
|
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
import monkey_patch.models
|
import monkey_patch.models
|
||||||
from ... import models
|
from ... import models
|
||||||
|
|
|
@ -1255,7 +1255,6 @@ class Item(models.Model):
|
||||||
offset += f.duration
|
offset += f.duration
|
||||||
#remove left over clips without annotations
|
#remove left over clips without annotations
|
||||||
Clip.objects.filter(item=self, annotations__id=None).delete()
|
Clip.objects.filter(item=self, annotations__id=None).delete()
|
||||||
self.update_find()
|
|
||||||
|
|
||||||
def srt(self, layer):
|
def srt(self, layer):
|
||||||
return ox.srt.encode([{
|
return ox.srt.encode([{
|
||||||
|
|
|
@ -59,6 +59,9 @@ def update_timeline(itemId):
|
||||||
def load_subtitles(itemId):
|
def load_subtitles(itemId):
|
||||||
item = models.Item.objects.get(itemId=itemId)
|
item = models.Item.objects.get(itemId=itemId)
|
||||||
item.load_subtitles()
|
item.load_subtitles()
|
||||||
|
item.update_find()
|
||||||
|
item.update_sort()
|
||||||
|
item.update_facets()
|
||||||
|
|
||||||
@task(ignore_resulsts=True, queue='default')
|
@task(ignore_resulsts=True, queue='default')
|
||||||
def update_sitemap(base_url):
|
def update_sitemap(base_url):
|
||||||
|
|
Loading…
Reference in a new issue