forked from 0x2620/pandora
make sure derivative name is set before encoding
This commit is contained in:
parent
18d9c93fff
commit
28aadd6a43
1 changed files with 6 additions and 2 deletions
|
@ -437,14 +437,18 @@ class Stream(models.Model):
|
|||
for f in config['formats']:
|
||||
derivative, created = Stream.objects.get_or_create(file=self.file,
|
||||
resolution=resolution, format=f)
|
||||
|
||||
name = derivative.name()
|
||||
name = os.path.join(os.path.dirname(self.video.name), name)
|
||||
if created:
|
||||
derivative.source = self
|
||||
derivative.save()
|
||||
name = derivative.name()
|
||||
derivative.video.name = os.path.join(os.path.dirname(self.video.name), name)
|
||||
derivative.video.name = name
|
||||
derivative.encode()
|
||||
derivative.save()
|
||||
elif rebuild or not derivative.available:
|
||||
if not derivative.video:
|
||||
derivative.video.name = name
|
||||
derivative.encode()
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue