From 58461287d4b8f61646a521fc5cb6cb83a8249096 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 16 Dec 2011 20:59:59 +0530 Subject: [PATCH] only extract timeline if needed --- pandora/archive/management/commands/import_streams.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/archive/management/commands/import_streams.py b/pandora/archive/management/commands/import_streams.py index d0316b43..25650c0e 100644 --- a/pandora/archive/management/commands/import_streams.py +++ b/pandora/archive/management/commands/import_streams.py @@ -3,6 +3,7 @@ from django.core.management.base import BaseCommand from django.conf import settings import os +from glob import glob from ... import models @@ -46,9 +47,9 @@ class Command(BaseCommand): for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None): s.source = models.Stream.objects.get(file=s.file, resolution=resolution, format=format) s.save() - #extract timelines for s in models.Stream.objects.filter(source=None): - s.make_timeline() + if not glob("%s*"%s.timeline_prefix): + s.make_timeline() s.file.selected = True s.file.save() s.file.item.update_timeline()