From 27040d16046dc95483f39ca983d2133461e80d5e Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Thu, 23 Jul 2020 07:04:42 -0700 Subject: [PATCH] Revert "Merge pull request #191 from RhetTbull/revert-190-Fix133" This reverts commit b7f4b739de978991def8ae2dca0f4e4b2881f56d, reversing changes made to da551036f9aae523bde0d354eb1222727ec4544b. --- osxphotos/photoinfo/_photoinfo_export.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osxphotos/photoinfo/_photoinfo_export.py b/osxphotos/photoinfo/_photoinfo_export.py index 6cb42324..ca000ac8 100644 --- a/osxphotos/photoinfo/_photoinfo_export.py +++ b/osxphotos/photoinfo/_photoinfo_export.py @@ -34,7 +34,7 @@ from .._constants import ( from .._export_db import ExportDBNoOp from ..exiftool import ExifTool from ..fileutil import FileUtil -from ..utils import dd_to_dms_str +from ..utils import dd_to_dms_str, findfiles ExportResults = namedtuple( "ExportResults", ["exported", "new", "updated", "skipped", "exif_updated"] @@ -428,11 +428,10 @@ def export2( # dest will be file1 (1).jpeg even though file1.jpeg doesn't exist to prevent sidecar collision if not update and increment and not overwrite: count = 1 - glob_str = str(dest.parent / f"{dest.stem}*") - dest_files = glob.glob(glob_str) - dest_files = [pathlib.Path(f).stem for f in dest_files] + dest_files = findfiles(f"{dest.stem}*", str(dest.parent)) + dest_files = [pathlib.Path(f).stem.lower() for f in dest_files] dest_new = dest.stem - while dest_new in dest_files: + while dest_new.lower() in dest_files: dest_new = f"{dest.stem} ({count})" count += 1 dest = dest.parent / f"{dest_new}{dest.suffix}"