From d3204863a5e155cbda8b4b6d821ba79e3d8049ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 8 Dec 2019 19:20:50 -0500 Subject: [PATCH] Skip path mapping containing empty string. --- bazarr/helper.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bazarr/helper.py b/bazarr/helper.py index 6f0e09ab0..0549feef6 100644 --- a/bazarr/helper.py +++ b/bazarr/helper.py @@ -16,6 +16,8 @@ def path_replace(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings): + if '' in path_mapping: + continue if path_mapping[0] in path: path = path.replace(path_mapping[0], path_mapping[1]) if path.startswith('\\\\') or re.match(r'^[a-zA-Z]:\\', path): @@ -31,6 +33,8 @@ def path_replace_reverse(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings): + if '' in path_mapping: + continue if path_mapping[1] in path: path = path.replace(path_mapping[1], path_mapping[0]) if path.startswith('\\\\') or re.match(r'^[a-zA-Z]:\\', path): @@ -46,6 +50,8 @@ def path_replace_movie(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings_movie): + if '' in path_mapping: + continue if path_mapping[0] in path: path = path.replace(path_mapping[0], path_mapping[1]) if path.startswith('\\\\') or re.match(r'^[a-zA-Z]:\\', path): @@ -61,6 +67,8 @@ def path_replace_reverse_movie(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings_movie): + if '' in path_mapping: + continue if path_mapping[1] in path: path = path.replace(path_mapping[1], path_mapping[0]) if path.startswith('\\\\') or re.match(r'^[a-zA-Z]:\\', path):