mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 05:25:28 +00:00
Fixed usage of pysubs2 removed exception in subliminal_patch
This commit is contained in:
parent
26ce9d73e6
commit
668ec386fc
1 changed files with 5 additions and 4 deletions
|
@ -357,7 +357,7 @@ class Subtitle(Subtitle_):
|
||||||
fragment = fragment.replace(r"\n", u"\n")
|
fragment = fragment.replace(r"\n", u"\n")
|
||||||
fragment = fragment.replace(r"\N", u"\n")
|
fragment = fragment.replace(r"\N", u"\n")
|
||||||
if sty.drawing:
|
if sty.drawing:
|
||||||
raise pysubs2.ContentNotUsable
|
return None
|
||||||
|
|
||||||
if format == "srt":
|
if format == "srt":
|
||||||
if sty.italic:
|
if sty.italic:
|
||||||
|
@ -390,9 +390,10 @@ class Subtitle(Subtitle_):
|
||||||
for i, line in enumerate(visible_lines, 1):
|
for i, line in enumerate(visible_lines, 1):
|
||||||
start = ms_to_timestamp(line.start, mssep=mssep)
|
start = ms_to_timestamp(line.start, mssep=mssep)
|
||||||
end = ms_to_timestamp(line.end, mssep=mssep)
|
end = ms_to_timestamp(line.end, mssep=mssep)
|
||||||
try:
|
|
||||||
text = prepare_text(line.text, sub.styles.get(line.style, SSAStyle.DEFAULT_STYLE))
|
text = prepare_text(line.text, sub.styles.get(line.style, SSAStyle.DEFAULT_STYLE))
|
||||||
except pysubs2.ContentNotUsable:
|
|
||||||
|
if text is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
out.append(u"%d\n" % i)
|
out.append(u"%d\n" % i)
|
||||||
|
|
Loading…
Reference in a new issue