From 4387d8e97efbb0ced7ca568159705fc06a70a10d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Jan 2014 12:05:07 +0000 Subject: [PATCH] reset possible error if enoding again --- pandora/archive/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 15fe3b2f3..76a378e46 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -388,10 +388,16 @@ class File(models.Model): return [self.path] + [i.path for i in self.instances.all()] def extract_stream(self): + ''' + extract stream from direct upload + ''' import tasks return tasks.extract_stream.delay(self.id) def process_stream(self): + ''' + extract derivatives from webm upload + ''' import tasks return tasks.process_stream.delay(self.id) @@ -585,6 +591,10 @@ class Stream(models.Model): ok, error = extract.stream(media, target, self.name(), info) if ok: self.available = True + self.error = '' + if self.file.failed: + self.file.failed = False + self.file.save() else: self.media = None self.available = False @@ -604,6 +614,10 @@ class Stream(models.Model): ok, error = extract.stream(media, target, self.name(), info, ffmpeg) if ok: self.available = True + self.error = '' + if self.file.failed: + self.file.failed = False + self.file.save() else: self.media = None self.available = False