From 697e501a4fea0b87927359be423f8274c5b86903 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 9 Mar 2016 14:13:34 +0530 Subject: [PATCH] only update item timeline once all parts are done --- pandora/archive/tasks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/archive/tasks.py b/pandora/archive/tasks.py index 2adefb36..5c6c1511 100644 --- a/pandora/archive/tasks.py +++ b/pandora/archive/tasks.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 -import os from glob import glob from celery.task import task from django.conf import settings -import ox +from django.db.models import Q from item.models import Item import models @@ -107,7 +106,8 @@ def process_stream(fileId): file.encoding = False file.save() file.item.update_selected(update_timeline=False) - if not file.item.rendered: + if not file.item.rendered \ + and not file.item.files.exclude(id=fileId).filter(Q(queued=True)|Q(encoding=True)).count(): file.item.update_timeline() if file.item.rendered: file.item.save()