From 67deea3099b2e4cec7c465ed7a825c6dd3e80d4d 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:28:23 -0500 Subject: [PATCH] Skip path mapping containing identical strings on both side. --- bazarr/helper.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bazarr/helper.py b/bazarr/helper.py index 0549feef6..55e765fd3 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 path_mapping[0] == path_mapping[1]: + continue if '' in path_mapping: continue if path_mapping[0] in path: @@ -33,6 +35,8 @@ def path_replace_reverse(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings): + if path_mapping[0] == path_mapping[1]: + continue if '' in path_mapping: continue if path_mapping[1] in path: @@ -50,6 +54,8 @@ def path_replace_movie(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings_movie): + if path_mapping[0] == path_mapping[1]: + continue if '' in path_mapping: continue if path_mapping[0] in path: @@ -67,6 +73,8 @@ def path_replace_reverse_movie(path): return None for path_mapping in ast.literal_eval(settings.general.path_mappings_movie): + if path_mapping[0] == path_mapping[1]: + continue if '' in path_mapping: continue if path_mapping[1] in path: