From b8f2b90210e6daef0340e8c41471b3a28521d72f Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 21 Jul 2023 14:49:28 -0400 Subject: [PATCH] fix delete files --- modules/ui_common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ui_common.py b/modules/ui_common.py index eeae5bfb3..32e89e5f2 100644 --- a/modules/ui_common.py +++ b/modules/ui_common.py @@ -58,6 +58,10 @@ def delete_files(js_data, images, _html_info, index): filenames.append(os.path.basename(fullfn)) try: os.remove(fullfn) + base, _ext = os.path.splitext(fullfn) + desc = f'{base}.txt' + if os.path.exists(desc): + os.remove(desc) fullfns.append(fullfn) shared.log.info(f"Deleting image: {fullfn}") except Exception as e: