summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-01-08 14:26:40 -0500
committermorpheus65535 <[email protected]>2022-01-08 14:26:40 -0500
commit58a967c892ef78cb6cf8ab790c2af8728e8c079e (patch)
tree3a80020628f9366c2daa700a1c762d4693c0cdb3 /libs
parent926f3d1f145596d1946e5be28db9b10e0dd20d74 (diff)
downloadbazarr-58a967c892ef78cb6cf8ab790c2af8728e8c079e.tar.gz
bazarr-58a967c892ef78cb6cf8ab790c2af8728e8c079e.zip
Added settings to change the hearing-impaired subtitles file extension to use when saving to disk.
Diffstat (limited to 'libs')
-rw-r--r--libs/subliminal_patch/core.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/subliminal_patch/core.py b/libs/subliminal_patch/core.py
index 08415a3c5..3ecd9d1b6 100644
--- a/libs/subliminal_patch/core.py
+++ b/libs/subliminal_patch/core.py
@@ -1011,17 +1011,22 @@ def get_subtitle_path(video_path, language=None, extension='.srt', forced_tag=Fa
:param language: language of the subtitle to put in the path.
:type language: :class:`~babelfish.language.Language`
:param str extension: extension of the subtitle.
+ :param bool forced_tag: is the subtitles forced/foreign?
+ :param bool hi_tag: is the subtitles hearing-impaired?
+ :param list tags: list of custom tags
:return: path of the subtitle.
:rtype: str
"""
subtitle_root = os.path.splitext(video_path)[0]
tags = tags or []
+ hi_extension = os.environ.get("SZ_HI_EXTENSION", "hi")
+
if forced_tag:
tags.append("forced")
elif hi_tag:
- tags.append("hi")
+ tags.append(hi_extension)
if language:
subtitle_root += '.' + str(language.basename)