From e9a1e5522a04268690edf2c921906bdafc95c3a7 Mon Sep 17 00:00:00 2001 From: Remy Date: Thu, 25 Aug 2011 20:57:22 -0700 Subject: [PATCH] Fixed encoder syntaxerror --- headphones/encode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headphones/encode.py b/headphones/encode.py index f771feae..6dd5a1f9 100644 --- a/headphones/encode.py +++ b/headphones/encode.py @@ -30,7 +30,7 @@ def encode(albumPath): for r,d,f in os.walk(albumPath): for music in f: - if any(music.endswith('.' + x) for x.lower() in headphones.MEDIA_FORMATS): + if any(music.lower().endswith('.' + x.lower()) for x in headphones.MEDIA_FORMATS): if (headphones.ENCODERLOSSLESS): if (music.lower().endswith('.flac')): musicFiles.append(os.path.join(r, music)) @@ -51,7 +51,7 @@ def encode(albumPath): for music in musicFiles: infoMusic=MediaFile(music) if headphones.ENCODER == 'lame': - if not any(music.endswith('.' + x) for x.lower() in ["mp3", "wav"]): + if not any(music.lower().endswith('.' + x) for x in ["mp3", "wav"]): logger.warn('Lame cant encode "%s" format for "%s", use ffmpeg' % (os.path.splitext(music)[1],music)) else: if (music.lower().endswith('.mp3') and (infoMusic.bitrate/1000<=headphones.BITRATE)): @@ -78,7 +78,7 @@ def encode(albumPath): time.sleep(1) for r,d,f in os.walk(albumPath): for music in f: - if any(music.endswith('.' + x) for x.lower() in headphones.MEDIA_FORMATS): + if any(music.lower().endswith('.' + x.lower()) for x in headphones.MEDIA_FORMATS): musicFinalFiles.append(os.path.join(r, music)) if ifencoded==0: