forked from 0x2620/pandora
only call update_timeline once during first import, adds empty clips twice otherwise
This commit is contained in:
parent
1be9bb04a8
commit
9a3c24b2ab
2 changed files with 5 additions and 4 deletions
|
@ -107,7 +107,7 @@ def process_stream(fileId):
|
|||
file = models.File.objects.get(id=fileId)
|
||||
file.encoding = False
|
||||
file.save()
|
||||
file.item.update_selected()
|
||||
file.item.update_selected(update_timeline=False)
|
||||
if not file.item.rendered:
|
||||
file.item.update_timeline()
|
||||
if file.item.rendered:
|
||||
|
|
|
@ -1164,7 +1164,7 @@ class Item(models.Model):
|
|||
qs = qs.exclude(id__in=wanted)
|
||||
qs.update(wanted=False)
|
||||
|
||||
def update_selected(self):
|
||||
def update_selected(self, update_timeline=True):
|
||||
sets = self.sets()
|
||||
for s in sets:
|
||||
if s.filter(Q(is_video=True)|Q(is_audio=True)).filter(available=False).count() == 0:
|
||||
|
@ -1180,7 +1180,8 @@ class Item(models.Model):
|
|||
if update:
|
||||
self.rendered = False
|
||||
self.save()
|
||||
tasks.update_timeline.delay(self.public_id)
|
||||
if update_timeline:
|
||||
tasks.update_timeline.delay(self.public_id)
|
||||
break
|
||||
if not sets:
|
||||
self.rendered = False
|
||||
|
@ -1536,7 +1537,7 @@ class Item(models.Model):
|
|||
return False
|
||||
with transaction.commit_on_success():
|
||||
layer = subtitles['id']
|
||||
Annotation.objects.filter(layer=layer,item=self).delete()
|
||||
Annotation.objects.filter(layer=layer, item=self).delete()
|
||||
offset = 0
|
||||
language = ''
|
||||
subtitles = self.files.filter(selected=True, is_subtitle=True, available=True)
|
||||
|
|
Loading…
Reference in a new issue