From e402886bd88da060d68e27453d935490c01f2f01 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 29 Dec 2010 16:18:42 +0530 Subject: [PATCH] not all file have samplerate --- pandora/archive/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index dc0fc7327..eb9a788a2 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -102,8 +102,8 @@ class File(models.Model): self.is_video = False if 'audio' in self.info and self.info['audio']: self.audio_codec = self.info['audio'][0]['codec'] - self.samplerate = self.info['audio'][0]['samplerate'] - self.channels = self.info['audio'][0]['channels'] + self.samplerate = self.info['audio'][0].get('samplerate', 0) + self.channels = self.info['audio'][0].get('channels', 0) if not self.is_video: self.is_audio = True