From 0870b1f018039e9d1cbd713d54d7509f27ddbf87 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 20 Nov 2012 17:21:13 -0500 Subject: [PATCH] CC-4697: airtime-import script fails silently on FLAC files - fixed --- utils/airtime-import/airtime-import.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/airtime-import/airtime-import.py b/utils/airtime-import/airtime-import.py index c77a0f21e..cb4ec80ba 100644 --- a/utils/airtime-import/airtime-import.py +++ b/utils/airtime-import/airtime-import.py @@ -8,6 +8,9 @@ import json import shutil import commands +sys.path.append('/usr/lib/airtime/media-monitor/mm2/') +from media.monitor.pure import is_file_supported + # create logger logger = logging.getLogger() @@ -53,8 +56,7 @@ def copy_or_move_files_to(paths, dest, flag): copy_or_move_files_to(sub_path, dest, flag) elif(os.path.isfile(path)): #copy file to dest - ext = os.path.splitext(path)[1] - if( 'mp3' in ext or 'ogg' in ext ): + if(is_file_supported(path)): destfile = dest+os.path.basename(path) if(flag == 'copy'): print "Copying %(src)s to %(dest)s..." % {'src':path, 'dest':destfile}