diff --git a/pandora/archive/tasks.py b/pandora/archive/tasks.py index 1920c6124..3dff1fcb2 100644 --- a/pandora/archive/tasks.py +++ b/pandora/archive/tasks.py @@ -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: diff --git a/pandora/item/models.py b/pandora/item/models.py index d602665f0..0d2035d25 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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)