From cef42cd54aa149a409cc406b95672f2e96083c5e Mon Sep 17 00:00:00 2001 From: Nose Date: Mon, 12 Jan 2026 23:30:21 -0800 Subject: [PATCH] f --- cmdlet/add_file.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmdlet/add_file.py b/cmdlet/add_file.py index bb77a6f..c7ac0ee 100644 --- a/cmdlet/add_file.py +++ b/cmdlet/add_file.py @@ -1634,7 +1634,15 @@ class Add_File(Cmdlet): c for c in title_value if c.isalnum() or c in " ._-()[]{}'`" ).strip() base_name = safe_title or media_path.stem - new_name = base_name + media_path.suffix + + # Fix to prevent double extensions (e.g., file.exe.exe) + # If the base name already ends with the extension of the media file, + # don't append it again. + file_ext = media_path.suffix + if file_ext and base_name.lower().endswith(file_ext.lower()): + new_name = base_name + else: + new_name = base_name + file_ext destination_root.mkdir(parents=True, exist_ok=True) target_path = destination_root / new_name