From f80d3ff52bf5d585e8917004fca6a7b113bd2c91 Mon Sep 17 00:00:00 2001 From: vilhelmmelkstam Date: Wed, 7 Aug 2019 21:48:30 +0200 Subject: [PATCH] Let file formats be case insensitive --- fdcm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fdcm.py b/fdcm.py index 05ef081..99c3b69 100644 --- a/fdcm.py +++ b/fdcm.py @@ -80,8 +80,10 @@ #find all video files input_files = [] -for x in range(len(file_formats)): - for file in glob.glob('*.'+file_formats[x]): +for file in glob.glob('*.*'): + _, file_extension = os.path.splitext(file) + file_format = file_extension.split('.')[-1] + if file_format.upper() in file_formats: input_files.append(file) input_files = sorted(input_files, key=str.lower) print("Input files:")