From 375ec5477863cf887b5abbac887c02443eb88459 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Mon, 28 Apr 2014 11:54:59 -0400 Subject: [PATCH] CC-5820: Airtime Analyzer: Length and MIME parsing skipped if file has no audio metadata tags. --- .../airtime_analyzer/airtime_analyzer/metadata_analyzer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py b/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py index 2d0e09fc2..d1e82c7a8 100644 --- a/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py +++ b/python_apps/airtime_analyzer/airtime_analyzer/metadata_analyzer.py @@ -29,8 +29,10 @@ class MetadataAnalyzer(Analyzer): #Bail if the file couldn't be parsed. The title should stay as the filename #inside Airtime. - if not audio_file: + if audio_file == None: # Don't use "if not" here. It is wrong due to mutagen's design. return metadata + # Note that audio_file can equal {} if the file is valid but there's no metadata tags. + # We can still try to grab the info variables below. #Grab other file information that isn't encoded in a tag, but instead usually #in the file header. Mutagen breaks that out into a separate "info" object: