From 750633eb7e7cc57e89ef1a44ac7e72e17f7d3eaa Mon Sep 17 00:00:00 2001 From: j Date: Thu, 15 Sep 2016 15:12:47 +0000 Subject: [PATCH] avoid recomputing timeline for each part --- pandora/archive/tasks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora/archive/tasks.py b/pandora/archive/tasks.py index d5f99f16..30f06b64 100644 --- a/pandora/archive/tasks.py +++ b/pandora/archive/tasks.py @@ -160,11 +160,13 @@ def extract_stream(fileId): if stream.available: stream.make_timeline() stream.extract_derivatives() + file.extract_tracks() # get current version from db file = models.File.objects.get(id=fileId) - file.item.update_timeline() - update_poster(file.item.public_id) - file.extract_tracks() + 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() + update_poster(file.item.public_id) models.File.objects.filter(id=fileId).update(encoding=False) Task.finish(file.item)