From 4aed6cbcaff8275b42a461f809c0ecd86086e65c Mon Sep 17 00:00:00 2001 From: Ven0m0 <82972344+Ven0m0@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:28:44 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Optimize=20Splitter.py=20absolute?= =?UTF-8?q?=20path=20resolution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- Cachyos/Scripts/WIP/gphotos/Splitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cachyos/Scripts/WIP/gphotos/Splitter.py b/Cachyos/Scripts/WIP/gphotos/Splitter.py index 74e1c59e..cd84632a 100644 --- a/Cachyos/Scripts/WIP/gphotos/Splitter.py +++ b/Cachyos/Scripts/WIP/gphotos/Splitter.py @@ -60,6 +60,8 @@ def group_photos(photos_folder, target_folder_size): photos_folder, f"Group_{current_group_num}" ) + abs_group_folder = os.path.abspath(current_group_folder) + for root, dirs, files in os.walk(photos_folder): # Exclude generated group folders from os.walk dirs[:] = [d for d in dirs if not d.startswith("Group_")] @@ -90,10 +92,11 @@ def group_photos(photos_folder, target_folder_size): create_new_folder(photos_folder, f"Group_{current_group_num}") current_group_size = 0 + abs_group_folder = os.path.abspath(current_group_folder) + # Move the file to the current group folder if it's not already there # We use absolute paths for comparison to be safe abs_file_path = os.path.abspath(file_path) - abs_group_folder = os.path.abspath(current_group_folder) if os.path.commonpath([abs_file_path, abs_group_folder]) != abs_group_folder: try: