From e3cda5c11e2449b7be1a5b1b81b03db4c49e5075 Mon Sep 17 00:00:00 2001 From: Paul Dee Date: Thu, 19 Oct 2023 23:39:02 +0200 Subject: [PATCH 1/2] Improved compression ratio of backup. --- bazarr/utilities/backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazarr/utilities/backup.py b/bazarr/utilities/backup.py index 7080cf950..95c2234dc 100644 --- a/bazarr/utilities/backup.py +++ b/bazarr/utilities/backup.py @@ -74,7 +74,7 @@ def backup_to_zip(): config_file = os.path.join(args.config_dir, 'config', 'config.yaml') logging.debug(f'Config file path to backup is: {config_file}') - with ZipFile(os.path.join(get_backup_path(), backup_filename), 'w') as backupZip: + with ZipFile(os.path.join(get_backup_path(), backup_filename), 'w', compression=ZIP_DEFLATED, compresslevel=9) as backupZip: if database_backup_file: backupZip.write(database_backup_file, 'bazarr.db') try: From c2aef83a20ed4dce7e102a5ef405915637a29e63 Mon Sep 17 00:00:00 2001 From: Vitiko <59455966+vitiko98@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:48:42 -0700 Subject: [PATCH 2/2] Avoid FileNotFoundError indexing subtitles (#2273) --- libs/subliminal_patch/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/subliminal_patch/core.py b/libs/subliminal_patch/core.py index 8be54828b..a8aaae19d 100644 --- a/libs/subliminal_patch/core.py +++ b/libs/subliminal_patch/core.py @@ -872,14 +872,14 @@ def _search_external_subtitles(path, languages=None, only_one=False, match_stric dirpath, filename = os.path.split(path) dirpath = dirpath or '.' fn_no_ext, fileext = os.path.splitext(filename) - fn_no_ext_lower = unicodedata.normalize('NFC', fn_no_ext.lower()) + fn_no_ext_lower = fn_no_ext.lower() # unicodedata.normalize('NFC', fn_no_ext.lower()) subtitles = {} for entry in scandir(dirpath): if not entry.is_file(follow_symlinks=False): continue - p = unicodedata.normalize('NFC', entry.name) + p = entry.name # unicodedata.normalize('NFC', entry.name) # keep only valid subtitle filenames if not p.lower().endswith(SUBTITLE_EXTENSIONS):