summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSamuel Bartík <[email protected]>2022-07-13 20:26:45 +0200
committerGitHub <[email protected]>2022-07-13 14:26:45 -0400
commit67259ec75da19f65369ffe356213c5596cf73012 (patch)
treef6d54d931ae16f92714701d13d049709611cd838
parent775f67b45e83ed62d9bd4f2cc068cde305c2c5a3 (diff)
downloadbazarr-67259ec75da19f65369ffe356213c5596cf73012.tar.gz
bazarr-67259ec75da19f65369ffe356213c5596cf73012.zip
Fix postprocessing escaping (#1907)v1.1.1-beta.4
-rw-r--r--bazarr/utilities/post_processing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bazarr/utilities/post_processing.py b/bazarr/utilities/post_processing.py
index 7a126e9cd..c28b2001b 100644
--- a/bazarr/utilities/post_processing.py
+++ b/bazarr/utilities/post_processing.py
@@ -5,9 +5,9 @@ import re
# Wraps the input string within quotes & escapes the string
def _escape(in_str):
- raw_map = {8:r'\b', 7:r'\a', 12:r'\f', 10:r'\n', 13:r'\r', 9:r'\t', 11:r'\v', 39:'\\\'', 34:'"', 92:'\\'}
+ raw_map = {8:r'\\b', 7:r'\\a', 12:r'\\f', 10:r'\\n', 13:r'\\r', 9:r'\\t', 11:r'\\v', 34:r'\"', 92:r'\\'}
raw_str = r''.join(raw_map.get(ord(i), i) for i in in_str)
- return f"'{raw_str}'"
+ return f"\"{raw_str}\""
def pp_replace(pp_command, episode, subtitles, language, language_code2, language_code3, episode_language, episode_language_code2, episode_language_code3, forced, score, subtitle_id, provider, series_id, episode_id, hi):
pp_command = re.sub(r'[\'"]?{{directory}}[\'"]?', _escape(os.path.dirname(episode)), pp_command)