summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-08-26 10:10:52 -0400
committermorpheus65535 <[email protected]>2021-08-26 10:10:52 -0400
commit75d85d05517a7547d36195b309809adfc402a8de (patch)
tree39250cfb0e1f10ec9e3854adae4fb19b22009ade
parent50fb06b23a502c3a108c2e17038e4bfe85cbcd59 (diff)
downloadbazarr-75d85d05517a7547d36195b309809adfc402a8de.tar.gz
bazarr-75d85d05517a7547d36195b309809adfc402a8de.zip
Fixed some issues with HI/forced in history and custom post-processing. #1516
-rw-r--r--bazarr/api.py12
-rw-r--r--bazarr/helper.py10
2 files changed, 13 insertions, 9 deletions
diff --git a/bazarr/api.py b/bazarr/api.py
index d7ffab4f5..28d29b192 100644
--- a/bazarr/api.py
+++ b/bazarr/api.py
@@ -856,8 +856,8 @@ class EpisodesSubtitles(Resource):
if sceneName is None: sceneName = "None"
language = request.form.get('language')
- forced = True if request.form.get('forced') == 'on' else False
- hi = True if request.form.get('hi') == 'on' else False
+ forced = True if request.form.get('forced') == 'true' else False
+ hi = True if request.form.get('hi') == 'true' else False
subFile = request.files.get('file')
_, ext = os.path.splitext(subFile.filename)
@@ -880,7 +880,9 @@ class EpisodesSubtitles(Resource):
message = result[0]
path = result[1]
subs_path = result[2]
- if forced:
+ if hi:
+ language_code = language + ":hi"
+ elif forced:
language_code = language + ":forced"
else:
language_code = language
@@ -1111,7 +1113,9 @@ class MoviesSubtitles(Resource):
message = result[0]
path = result[1]
subs_path = result[2]
- if forced:
+ if hi:
+ language_code = language + ":hi"
+ elif forced:
language_code = language + ":forced"
else:
language_code = language
diff --git a/bazarr/helper.py b/bazarr/helper.py
index 551a10fc8..7b258af76 100644
--- a/bazarr/helper.py
+++ b/bazarr/helper.py
@@ -118,11 +118,11 @@ def pp_replace(pp_command, episode, subtitles, language, language_code2, languag
pp_command = pp_command.replace('{{episode}}', episode)
pp_command = pp_command.replace('{{episode_name}}', os.path.splitext(os.path.basename(episode))[0])
pp_command = pp_command.replace('{{subtitles}}', str(subtitles))
- pp_command = pp_command.replace('{{subtitles_language}}', str(language) + modifier_string)
- pp_command = pp_command.replace('{{subtitles_language_code2}}', str(language_code2) + modifier_code)
- pp_command = pp_command.replace('{{subtitles_language_code3}}', str(language_code3) + modifier_code)
- pp_command = pp_command.replace('{{subtitles_language_code2_dot}}', str(language_code2) + modifier_code_dot)
- pp_command = pp_command.replace('{{subtitles_language_code3_dot}}', str(language_code3) + modifier_code_dot)
+ pp_command = pp_command.replace('{{subtitles_language}}', str(language))
+ pp_command = pp_command.replace('{{subtitles_language_code2}}', str(language_code2))
+ pp_command = pp_command.replace('{{subtitles_language_code3}}', str(language_code3))
+ pp_command = pp_command.replace('{{subtitles_language_code2_dot}}', str(language_code2).replace(':', '.'))
+ pp_command = pp_command.replace('{{subtitles_language_code3_dot}}', str(language_code3).replace(':', '.'))
pp_command = pp_command.replace('{{episode_language}}', str(episode_language))
pp_command = pp_command.replace('{{episode_language_code2}}', str(episode_language_code2))
pp_command = pp_command.replace('{{episode_language_code3}}', str(episode_language_code3))