From 8dfced9d94b34b256dc02283782b220803e55408 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sat, 21 Mar 2026 17:16:32 +0800 Subject: [PATCH] Avoid self-copy when no timestamp --- Whatsapp_Chat_Exporter/media_timestamp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Whatsapp_Chat_Exporter/media_timestamp.py b/Whatsapp_Chat_Exporter/media_timestamp.py index 954219c..541649e 100644 --- a/Whatsapp_Chat_Exporter/media_timestamp.py +++ b/Whatsapp_Chat_Exporter/media_timestamp.py @@ -176,9 +176,10 @@ def process_media_with_timestamp( """ # If no timestamp available, just copy if timestamp is None: - logger.warning(f"No timestamp available for {source_path}, skipping timestamp operations") - shutil.copy2(source_path, dest_path) - return dest_path + if source_path != dest_path: + logger.warning(f"No timestamp available for {source_path}, skipping timestamp operations") + shutil.copy2(source_path, dest_path) + return dest_path # Determine final path final_path = dest_path