From b69c5e7f69e9e51a62202a63f3d5f324f8f62499 Mon Sep 17 00:00:00 2001 From: redvers76 Date: Thu, 1 Sep 2011 13:18:08 +0200 Subject: [PATCH] Need to lower() the files to ensure .MP3 and .Mp3 are picked up as valid suffixes during post processing --- headphones/postprocessor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 05c04da0..4141e98e 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -118,7 +118,7 @@ def verify(albumid, albumpath): for r,d,f in os.walk(albumpath): for files in f: - if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS): + if any(files.lower().endswith('.' + x.lower()) for x in headphones.MEDIA_FORMATS): downloaded_track_list.append(os.path.join(r, files)) # test #1: metadata - usually works @@ -278,7 +278,7 @@ def cleanupFiles(albumpath): logger.info('Cleaning up files') for r,d,f in os.walk(albumpath): for files in f: - if not any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS): + if not any(files.lower().endswith('.' + x.lower()) for x in headphones.MEDIA_FORMATS): logger.debug('Removing: %s' % files) try: os.remove(os.path.join(r, files)) @@ -473,7 +473,7 @@ def updateHave(albumpath): for r,d,f in os.walk(albumpath): for files in f: - if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS): + if any(files.lower().endswith('.' + x.lower()) for x in headphones.MEDIA_FORMATS): results.append(os.path.join(r, files)) if results: