This commit is contained in:
2026-06-30 15:13:52 -07:00
parent 2c0d01704f
commit 1ee7d7210a
2 changed files with 15 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ set -euo pipefail
OUTPUT_SOURCE="$HOME/ComfyUI/output" OUTPUT_SOURCE="$HOME/ComfyUI/output"
VIDEO_SOURCE="$HOME/ComfyUI/videos" VIDEO_SOURCE="$HOME/ComfyUI/videos"
AUDIO_SOURCE="$HOME/ComfyUI/audio" AUDIO_SOURCE="$HOME/ComfyUI/output/audio"
SHARE_DIR="/mini.nas/miniShare1/Pictures" SHARE_DIR="/mini.nas/miniShare1/Pictures"
STATE_FILE="$HOME/.local/state/comfyui-sync.state" STATE_FILE="$HOME/.local/state/comfyui-sync.state"
NEATCLI="$(command -v /home/linuxbrew/.linuxbrew/bin/neatcli || true)" NEATCLI="$(command -v /home/linuxbrew/.linuxbrew/bin/neatcli || true)"

View File

@@ -422,8 +422,11 @@ def main():
while new_path.exists(): while new_path.exists():
new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}") new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}")
counter += 1 counter += 1
try:
old_path.rename(new_path) old_path.rename(new_path)
renamed += 1 renamed += 1
except FileNotFoundError:
print(f" SKIPPED (not found): {old_path.name}")
print(f" Renamed {renamed} file(s).") print(f" Renamed {renamed} file(s).")
else: else:
renamed = 0 renamed = 0
@@ -487,7 +490,10 @@ def main():
while np.exists(): while np.exists():
np = p.with_name(f"{stem}_{counter}{p.suffix}") np = p.with_name(f"{stem}_{counter}{p.suffix}")
counter += 1 counter += 1
try:
p.rename(np) p.rename(np)
except FileNotFoundError:
print(f" SKIPPED (not found): {p.name}")
renamed += len(items) - i renamed += len(items) - i
break break
else: else:
@@ -505,8 +511,11 @@ def main():
new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}") new_path = old_path.with_name(f"{stem}_{counter}{old_path.suffix}")
counter += 1 counter += 1
print(f" (file existed, saved as {new_path.name})") print(f" (file existed, saved as {new_path.name})")
try:
old_path.rename(new_path) old_path.rename(new_path)
renamed += 1 renamed += 1
except FileNotFoundError:
print(f" SKIPPED (not found): {old_path.name}")
i += 1 i += 1
print(f"\n Renamed: {renamed} Skipped: {skipped}") print(f"\n Renamed: {renamed} Skipped: {skipped}")