fix: sort with casefold, case insensitive

https://docs.python.org/3/library/stdtypes.html#str.casefold
This commit is contained in:
Manuel Schmid 2024-02-12 21:34:07 +01:00
parent f4a8bf24cf
commit a78f66ffb5
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B

View File

@ -168,7 +168,7 @@ def get_files_from_folder(folder_path, exensions=None, name_filter=None):
relative_path = os.path.relpath(root, folder_path)
if relative_path == ".":
relative_path = ""
for filename in sorted(files):
for filename in sorted(files, key=lambda s: s.casefold()):
_, file_extension = os.path.splitext(filename)
if (exensions == None or file_extension.lower() in exensions) and (name_filter == None or name_filter in _):
path = os.path.join(relative_path, filename)