From: yomguy Date: Sun, 22 Jul 2012 22:26:12 +0000 (+0200) Subject: fix audio tag, fix mp3 mime detection X-Git-Tag: 0.7.1^2~17 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=58a0d89701405a16a9ff59e905c360a11eba7b05;p=teleforma.git fix audio tag, fix mp3 mime detection --- diff --git a/teleforma/models.py b/teleforma/models.py index 83e38e4e..4da98173 100755 --- a/teleforma/models.py +++ b/teleforma/models.py @@ -432,7 +432,11 @@ class Media(MediaBase): def set_mime_type(self): if self.item.file: - self.mime_type = mimetypes.guess_type(self.item.file.path)[0] + mime_type = mimetypes.guess_type(self.item.file.path)[0] + if mime_type == 'audio/mpeg': + self.mime_type = 'audio/mp3' + else: + self.mime_type = mime_type self.save() def __unicode__(self): diff --git a/teleforma/templates/teleforma/course_media.html b/teleforma/templates/teleforma/course_media.html index 29fbed62..0b5155d4 100644 --- a/teleforma/templates/teleforma/course_media.html +++ b/teleforma/templates/teleforma/course_media.html @@ -61,7 +61,7 @@ $(document).ready(function(){ {% elif "audio" in media.mime_type %}
-