tab 5
This commit is contained in:
13
engine.py
13
engine.py
@@ -127,7 +127,7 @@ class SorterEngine:
|
|||||||
# --- IMAGE & ID SCANNING ---
|
# --- IMAGE & ID SCANNING ---
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_images(path, recursive=False):
|
def get_images(path, recursive=False):
|
||||||
"""Standard image scanner with optional subfolder support."""
|
"""Scanning logic updated to include png explicitly."""
|
||||||
exts = ('.jpg', '.jpeg', '.png', '.webp', '.bmp', '.tiff')
|
exts = ('.jpg', '.jpeg', '.png', '.webp', '.bmp', '.tiff')
|
||||||
if not path or not os.path.exists(path): return []
|
if not path or not os.path.exists(path): return []
|
||||||
image_list = []
|
image_list = []
|
||||||
@@ -141,6 +141,17 @@ class SorterEngine:
|
|||||||
return sorted(image_list)
|
return sorted(image_list)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
def bulk_cleanup(file_paths, action="unused", root_path=None):
|
||||||
|
"""Handles the 'Finish' button logic: either delete or move to unused."""
|
||||||
|
for p in file_paths:
|
||||||
|
if not os.path.exists(p): continue
|
||||||
|
if action == "delete":
|
||||||
|
os.remove(p)
|
||||||
|
else:
|
||||||
|
dest = os.path.join(root_path, "unused", os.path.basename(p))
|
||||||
|
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
||||||
|
shutil.move(p, dest)
|
||||||
|
@staticmethod
|
||||||
def get_id_mapping(path):
|
def get_id_mapping(path):
|
||||||
"""Groups files by idXXX_ prefix to detect collisions."""
|
"""Groups files by idXXX_ prefix to detect collisions."""
|
||||||
mapping = {}
|
mapping = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user