Skip to content

Commit

Permalink
Fixed issue with translation failing when nothing is returned by Goog…
Browse files Browse the repository at this point in the history
…le Translate. #2519
  • Loading branch information
morpheus65535 committed Oct 23, 2024
1 parent e8077d6 commit b34a0c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bazarr/subtitles/tools/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ def translate_line(id, line, attempt):
logging.debug(f'BAZARR saving translated subtitles to {dest_srt_file}')
for i, line in enumerate(subs):
try:
line.plaintext = lines_list[i]
if lines_list[i]:
line.plaintext = lines_list[i]
else:
# we assume that there was nothing to translate if Google returns None. ex.: "♪♪"
continue
except IndexError:
logging.error(f'BAZARR is unable to translate malformed subtitles: {source_srt_file}')
return False
Expand Down

0 comments on commit b34a0c1

Please sign in to comment.