From bb283e195af25b9b338906903baa59d5871988d3 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Tue, 21 Jun 2011 17:13:33 +0200 Subject: [PATCH] cc-1799 Readable Filesystem check if md dictionary has any md. --- python_apps/media-monitor/MediaMonitor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python_apps/media-monitor/MediaMonitor.py b/python_apps/media-monitor/MediaMonitor.py index d9ca1aa90..47553bc80 100644 --- a/python_apps/media-monitor/MediaMonitor.py +++ b/python_apps/media-monitor/MediaMonitor.py @@ -150,10 +150,11 @@ class MetadataExtractor: md['MDATA_KEY_MD5'] = md5 file_info = mutagen.File(filepath, easy=True) - attrs = self.mutagen2airtime - for key in file_info.keys() : - if key in attrs : - md[attrs[key]] = file_info[key][0] + #check if file has any metadata + if len(file_info) > 0: + for key in file_info.keys() : + if key in attrs : + md[self.mutagen2airtime[key]] = file_info[key][0] if 'MDATA_KEY_TITLE' not in md: #get rid of file extention from original name, name might have more than 1 '.' in it.