diff options
author | morpheus65535 <[email protected]> | 2022-03-25 06:54:56 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-03-25 06:54:56 -0400 |
commit | 55399380ada67fae9b98a5ea9884aea08e475e7e (patch) | |
tree | 791a41893757e4ab25c34f8d260f3853eb1452a7 | |
parent | 11ccbb278b36f626358e82e98d65efcb0ab0882b (diff) | |
download | bazarr-1.0.4-beta.15.tar.gz bazarr-1.0.4-beta.15.zip |
Fixed update mechanism when running Bazarr from %programdata%\Bazarr on Windows. #1768v1.0.4-beta.15
-rw-r--r-- | bazarr/check_update.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bazarr/check_update.py b/bazarr/check_update.py index 8f0d61a15..cd13314b2 100644 --- a/bazarr/check_update.py +++ b/bazarr/check_update.py @@ -194,16 +194,20 @@ def update_cleaner(zipfile, bazarr_dir, config_dir): separator + '__pycache__' + separator + '$'] if os.path.abspath(bazarr_dir).lower() == os.path.abspath(config_dir).lower(): # for users who installed Bazarr inside the config directory (ie: `%programdata%\Bazarr` on windows) - with os.scandir(config_dir) as directories: - for directory in directories: - if directory.is_dir(): - dir_to_ignore.append('^' + directory.name + os.path.sep) + dir_to_ignore.append('^backup' + separator) + dir_to_ignore.append('^cache' + separator) + dir_to_ignore.append('^config' + separator) + dir_to_ignore.append('^db' + separator) + dir_to_ignore.append('^log' + separator) + dir_to_ignore.append('^restore' + separator) + dir_to_ignore.append('^update' + separator) elif os.path.abspath(bazarr_dir).lower() in os.path.abspath(config_dir).lower(): # when config directory is a child of Bazarr installation directory - 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)) + dir_to_ignore.append('^' + os.path.relpath(config_dir, bazarr_dir) + separator) + dir_to_ignore_regex_string = '(?:% s)' % '|'.join(dir_to_ignore) logging.debug(f'BAZARR upgrade leftover cleaner will ignore directories matching this ' - f'regex: {dir_to_ignore_regex.pattern}') + f'regex: {dir_to_ignore_regex_string}') + dir_to_ignore_regex = re.compile(dir_to_ignore_regex_string) file_to_ignore = ['nssm.exe', '7za.exe', 'unins000.exe', 'unins000.dat'] logging.debug('BAZARR upgrade leftover cleaner will ignore those files: {}'.format(', '.join(file_to_ignore))) |