From 010c555e5ae1a12f017ffb00262ebdce4112e976 Mon Sep 17 00:00:00 2001 From: Roxi Dittberner Date: Tue, 21 Oct 2025 23:16:47 +0200 Subject: [PATCH 1/3] Added name duplication prevention --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 48477fe..626358d 100755 --- a/main.py +++ b/main.py @@ -82,6 +82,9 @@ def main(): else: category: str = "" path: str = outputFolder + category + "/" + newname + extension + if os.path.exists(path): + newname = input("Name already in use, please choose another: ") + path = outputFolder + category + "/" + newname + extension shutil.move(inputFolder + file, path) if args.reformat: if extension != ".mp4": From 33ea029c37a18c2e1313387e0830ea1ef85e2685 Mon Sep 17 00:00:00 2001 From: Roxi Dittberner Date: Tue, 21 Oct 2025 23:24:54 +0200 Subject: [PATCH 2/3] added option to delete files --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 626358d..f692179 100755 --- a/main.py +++ b/main.py @@ -74,8 +74,11 @@ def main(): else: newname = file if args.classify: + print(f"Existing categories: {os.listdir(outputFolder)}") category: str = input("Category: ") - if not os.path.exists(outputFolder + category) or not os.path.isdir( + if category == "delete": + os.remove(inputFolder + file) + elif not os.path.exists(outputFolder + category) or not os.path.isdir( outputFolder + category ): os.mkdir(outputFolder + category) From e016083f1ca3e2522ebe00702a224827e273f994 Mon Sep 17 00:00:00 2001 From: Roxi Dittberner Date: Tue, 21 Oct 2025 23:26:24 +0200 Subject: [PATCH 3/3] clarified input prompts --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index f692179..076b86a 100755 --- a/main.py +++ b/main.py @@ -70,12 +70,12 @@ def main(): extension: str = file.rpartition(".")[-1] or "" if extension != "": extension = "." + extension - newname = input("New name: ") + newname = input("Enter new name: ") else: newname = file if args.classify: print(f"Existing categories: {os.listdir(outputFolder)}") - category: str = input("Category: ") + category: str = input("Enter category or delete to permanently delete file: ") if category == "delete": os.remove(inputFolder + file) elif not os.path.exists(outputFolder + category) or not os.path.isdir( @@ -86,7 +86,7 @@ def main(): category: str = "" path: str = outputFolder + category + "/" + newname + extension if os.path.exists(path): - newname = input("Name already in use, please choose another: ") + newname = input("Name already in use, please enter another name: ") path = outputFolder + category + "/" + newname + extension shutil.move(inputFolder + file, path) if args.reformat: