forked from 0x2620/pandora
not all file have samplerate
This commit is contained in:
parent
da8aa69bf1
commit
e402886bd8
1 changed files with 2 additions and 2 deletions
|
@ -102,8 +102,8 @@ class File(models.Model):
|
||||||
self.is_video = False
|
self.is_video = False
|
||||||
if 'audio' in self.info and self.info['audio']:
|
if 'audio' in self.info and self.info['audio']:
|
||||||
self.audio_codec = self.info['audio'][0]['codec']
|
self.audio_codec = self.info['audio'][0]['codec']
|
||||||
self.samplerate = self.info['audio'][0]['samplerate']
|
self.samplerate = self.info['audio'][0].get('samplerate', 0)
|
||||||
self.channels = self.info['audio'][0]['channels']
|
self.channels = self.info['audio'][0].get('channels', 0)
|
||||||
|
|
||||||
if not self.is_video:
|
if not self.is_video:
|
||||||
self.is_audio = True
|
self.is_audio = True
|
||||||
|
|
Loading…
Reference in a new issue