mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-24 14:47:16 -04:00
Skip path mapping containing empty string.
This commit is contained in:
parent
ed097cbd7f
commit
d3204863a5
1 changed files with 8 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue