From 35eb535b03d52ef53cf18822459f1ef101d34901 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 10 May 2013 11:45:42 +0200 Subject: [PATCH] dont set path if encoding failes, set path if not set --- pandora/archive/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 881722bb..086d0132 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -505,15 +505,20 @@ class Stream(models.Model): def encode(self): if self.source: media = self.source.media.path + if not self.media: + self.media.name = os.path.join(os.path.dirname(self.source.media.name), self.name()) target = self.media.path info = ox.avinfo(media) if extract.stream(media, target, self.name(), info): self.available = True else: + self.media = None self.available = False self.save() elif self.file.data: media = self.file.data.path + if not self.media: + self.media.name = self.path(self.name()) target = self.media.path info = ox.avinfo(media) if extract.stream(media, target, self.name(), info):