From 6a86a75ceea36508dafb125f3dfdc800f1d09e3b Mon Sep 17 00:00:00 2001
From: Albert Santoni <albert.santoni@sourcefabric.org>
Date: Mon, 21 Apr 2014 17:50:10 -0400
Subject: [PATCH] CC-5709: Airtime Analyzer

* Fixed CC-5799: Incorrect Mime on import
---
 .../airtime_analyzer/airtime_analyzer/metadata_analyzer.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py b/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py
index 71462c45d..4e4139be0 100644
--- a/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py
+++ b/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py
@@ -46,8 +46,11 @@ class MetadataAnalyzer(Analyzer):
         metadata["cueout"] = metadata["length"] 
       
         #Use the python-magic module to get the MIME type.
-        mime_magic = magic.Magic(mime=True)
-        metadata["mime"] = mime_magic.from_file(filename)
+        if audio_file.mime:
+            metadata["mime"] = audio_file.mime[0]
+        else:
+            mime_magic = magic.Magic(mime=True)
+            metadata["mime"] = mime_magic.from_file(filename)
    
         #Try to get the number of channels if mutagen can...
         try: