From dd80fec9d4a6d5a5af1e7d41bbcebb07c43ae35c Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Fri, 6 Aug 2021 10:29:58 -0400 Subject: [PATCH] Fixed issue with upgrade cleanup routine when installed with Windows Installer. --- bazarr/check_update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bazarr/check_update.py b/bazarr/check_update.py index b3c7fbd87..ca8ff3d85 100644 --- a/bazarr/check_update.py +++ b/bazarr/check_update.py @@ -180,10 +180,13 @@ def update_cleaner(zipfile, bazarr_dir, config_dir): dir_to_ignore = ['^.' + os.path.sep, '^bin' + os.path.sep, '^venv' + os.path.sep, + '^WinPython' + os.path.sep, os.path.sep + '__pycache__' + os.path.sep + '$'] if os.path.abspath(bazarr_dir) in os.path.abspath(config_dir): dir_to_ignore.append('^' + os.path.relpath(config_dir, bazarr_dir) + os.path.sep) dir_to_ignore_regex = re.compile('(?:% s)' % '|'.join(dir_to_ignore)) + + file_to_ignore = ['nssm.exe', '7za.exe'] extension_to_ignore = ['.pyc'] file_on_disk = [] @@ -196,7 +199,9 @@ def update_cleaner(zipfile, bazarr_dir, config_dir): folder_list.append(relative_foldername) for file in filenames: - if os.path.splitext(file)[1] in extension_to_ignore: + if file in file_to_ignore: + continue + elif os.path.splitext(file)[1] in extension_to_ignore: continue elif foldername == bazarr_dir: file_on_disk.append(file)