From 39f42aa1dd8d8d3292c55ed9d980c0813c4d10f5 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 22 Aug 2011 09:05:14 +0200 Subject: [PATCH] subs are not video or audio --- pandora/archive/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 9cfed69f5..bfbaf3bbc 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -127,7 +127,7 @@ class File(models.Model): self.display_aspect_ratio = "4:3" self.width = '320' self.height = '240' - if 'audio' in self.info and self.info['audio']: + if 'audio' in self.info and self.info['audio'] and self.duration > 0: audio = self.info['audio'][0] self.audio_codec = audio['codec'] self.samplerate = audio.get('samplerate', 0) @@ -137,6 +137,9 @@ class File(models.Model): self.is_audio = True else: self.is_audio = False + self.audio_codec = '' + self.sampleate = 0 + self.channels = 0 if self.framerate: self.pixels = int(self.width * self.height * float(utils.parse_decimal(self.framerate)) * self.duration)