mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 13:35:18 +00:00
Fixed issue with translation failing when nothing is returned by Google Translate. #2519
This commit is contained in:
parent
e8077d64df
commit
b34a0c19a2
1 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,11 @@ def translate_subtitles_file(video_path, source_srt_file, from_lang, to_lang, fo
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue