aboutsummaryrefslogtreecommitdiffhomepage
path: root/custom_libs
diff options
context:
space:
mode:
authorAnderson Shindy Oki <[email protected]>2024-06-25 21:48:18 +0900
committerGitHub <[email protected]>2024-06-25 08:48:18 -0400
commit668ec386fc6eb2da53a68b3aaf8744ae364aaa97 (patch)
treec111a889fe4099e3a18f0f63005783403e50d396 /custom_libs
parent26ce9d73e6b6c4cc1e219deba722c0eaab4b3187 (diff)
downloadbazarr-668ec386fc6eb2da53a68b3aaf8744ae364aaa97.tar.gz
bazarr-668ec386fc6eb2da53a68b3aaf8744ae364aaa97.zip
Fixed usage of pysubs2 removed exception in subliminal_patch
Diffstat (limited to 'custom_libs')
-rw-r--r--custom_libs/subliminal_patch/subtitle.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/custom_libs/subliminal_patch/subtitle.py b/custom_libs/subliminal_patch/subtitle.py
index 36afea6d2..c19acd1ec 100644
--- a/custom_libs/subliminal_patch/subtitle.py
+++ b/custom_libs/subliminal_patch/subtitle.py
@@ -357,7 +357,7 @@ class Subtitle(Subtitle_):
fragment = fragment.replace(r"\n", u"\n")
fragment = fragment.replace(r"\N", u"\n")
if sty.drawing:
- raise pysubs2.ContentNotUsable
+ return None
if format == "srt":
if sty.italic:
@@ -390,9 +390,10 @@ class Subtitle(Subtitle_):
for i, line in enumerate(visible_lines, 1):
start = ms_to_timestamp(line.start, mssep=mssep)
end = ms_to_timestamp(line.end, mssep=mssep)
- try:
- text = prepare_text(line.text, sub.styles.get(line.style, SSAStyle.DEFAULT_STYLE))
- except pysubs2.ContentNotUsable:
+
+ text = prepare_text(line.text, sub.styles.get(line.style, SSAStyle.DEFAULT_STYLE))
+
+ if text is None:
continue
out.append(u"%d\n" % i)