Skip to content

Commit

Permalink
QA spreadsheet issues 3,6
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavinov-actionengine committed Jun 24, 2024
1 parent 80af7c5 commit 932a4f7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions openformats/formats/vtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def parse(self, content, **kwargs):
self.transcriber.copy_until(len(source))

template = self.transcriber.get_destination()
if not template.startswith("WEBVTT"):
if len(stringset) == 0:
raise ParseError("There are no strings to translate")
elif not template.startswith("WEBVTT"):
raise ParseError("VTT file should start with 'WEBVTT'!")
return template, stringset

Expand Down Expand Up @@ -101,10 +103,6 @@ def _parse_section(self, offset, section):

# Content
string_to_translate = "\n".join(src_strings[timings_index + 1 :])
if string_to_translate == "":
raise ParseError(
f"Subtitle is empty on line {self.transcriber.line_number + 2}"
)

string = OpenString(
timings,
Expand Down

0 comments on commit 932a4f7

Please sign in to comment.