mpv2oboeru

mpv helpers to create flashcards from movies and TV shows
git clone anongit@rnpnr.xyz:mpv2oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: ddd03189939e679c5692221924c49a35064f86d3
Parent: 601303f2b3602a92680b108563c05165d315abe5
Author: Ren Tatsumoto
Date:   Tue, 17 Nov 2020 20:21:05 +0300

protect from strange use cases

Diffstat:
Msubs2srs.lua | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -440,7 +440,14 @@ local function append_forvo_pronunciation(note1, note2) return note1 end if config.use_forvo == 'always' or is_empty(note2[config.vocab_audio_field]) then - note1[config.vocab_audio_field] = get_forvo_pronunciation(note2[config.vocab_field]) + local forvo_pronunciation = get_forvo_pronunciation(note2[config.vocab_field]) + if not is_empty(forvo_pronunciation) then + if config.vocab_audio_field == config.audio_field then + note1[config.vocab_audio_field] = forvo_pronunciation .. note1[config.vocab_audio_field] + else + note1[config.vocab_audio_field] = forvo_pronunciation + end + end end return note1 end