actually extract derivatives

This commit is contained in:
j 2011-08-18 22:35:43 +02:00
parent 25f44d92be
commit 6ca1fccc80

View file

@ -494,12 +494,12 @@ class Stream(models.Model):
for f in settings.VIDEO_FORMATS: for f in settings.VIDEO_FORMATS:
derivative, created = Stream.objects.get_or_create(file=self.file, derivative, created = Stream.objects.get_or_create(file=self.file,
resolution=resolution, format=f) resolution=resolution, format=f)
if created: if created:
derivative.source = self derivative.source = self
name = derivative.name() name = derivative.name()
derivative.video.name = os.path.join(os.path.dirname(self.video.name), name) derivative.video.name = os.path.join(os.path.dirname(self.video.name), name)
derivative.encode() derivative.encode()
derivative.save() derivative.save()
return True return True
def encode(self): def encode(self):