]> git.treefish.org Git - photosort.git/blobdiff - src/misc.py
do not look for alternative file in source dir
[photosort.git] / src / misc.py
index 4cbbf74e9f2787af3a40d09cd41593bfe8900080..7ef46f36ffd5313ed1451c1add276e2024c7f7b6 100644 (file)
@@ -12,8 +12,10 @@ def walk_media_files(dir_path):
 def extract_timestamp(file_path):
     return os.path.getmtime(file_path)
 
-def find_file(dir_path, file_name, file_size):
+def find_file(dir_path, file_name, file_size, exclude_dir):
     for root, dirs, files in os.walk(dir_path):
+        if root == exclude_dir:
+            continue
         for f in files:
             if f == file_name:
                 full_path = os.path.join(root, f)