fix directory rename error for ffmpeg handling

This commit is contained in:
Lucas Faber authored and Lucas Vivohost committed 2026-09-14 09:20:47 +02:00
1 parent 346aa2e8b6
commit 8379439eed
1 file changed
+8 -8
+8 -8
View File
@@ -23,7 +23,7 @@ UNWANTED_PATTERNS_PRE = [
]
GARBAGE_PATTERNS = [
r"www\.YTS.*", r".*\.nfo", r"RARBG.*", r".*YIFY.*\.jpg", f"Torrent Downloaded From.*txt", "Screens"
r"Downloaded From.*", r"www\.YTS.*", r".*\.nfo", r"YTSY.*", r"RARBG.*", r".*YIFY.*\.jpg", f"Torrent Downloaded From.*txt", "Screens"
]
DAMAGE_PATTERNS = [
@@ -94,6 +94,13 @@ def rename_files(base: Path, args):
def rename_directories(base: Path, args):
# reverse order → avoid renaming parent first
paths = [base] + list(base.rglob("*"))
new_base = base
if base.is_dir():
new_base = clean_name(base, args.search, args.replace)
if args.capitalize:
new_base = capitalize_name(new_base)
new_base = base.with_name(new_base)
for path in sorted(paths, reverse=True):
if not path.is_dir():
continue
@@ -104,13 +111,6 @@ def rename_directories(base: Path, args):
new_path = path.with_name(new_name)
safe_rename(path, new_path, args.dryrun, args.confirm)
new_base = clean_name(base, args.search, args.replace)
if args.capitalize:
new_base = capitalize_name(new_base)
new_base = base.with_name(new_base)
return new_base
def repair_names(base: Path, args):