CC-5709: Airtime Analyzer

* Fixed CC-5799: Incorrect Mime on import
This commit is contained in:
Albert Santoni 2014-04-21 17:50:10 -04:00
parent cdce4ca104
commit 6a86a75cee
1 changed files with 5 additions and 2 deletions

View File

@ -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: