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: 778de4726d29a2b2f0f83caf732fff032b7682be
Parent: 0704fb2c9e1dd0a31291112d86ed2040949159b9
Author: Ren Tatsumoto
Date:   Sat, 19 Sep 2020 16:39:03 +0300

if 'overwrite' is not set, append new media links at the end without erasing previous content of fields

Diffstat:
Msubs2srs.lua | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -304,7 +304,7 @@ local function export_to_anki(gui) end end -local function update_last_note() +local function update_last_note(overwrite) local sub = subs.get() local last_note_id = ankiconnect.get_last_note_id() subs.clear() @@ -329,7 +329,7 @@ local function update_last_note() ffmpeg.create_snapshot(snapshot_timestamp, snapshot_filename) ffmpeg.create_audio(sub['start'], sub['end'], audio_filename) - ankiconnect.append_media(last_note_id, audio_filename, snapshot_filename) + ankiconnect.append_media(last_note_id, audio_filename, snapshot_filename, overwrite) end local function get_empty_timings() @@ -534,7 +534,7 @@ ankiconnect.get_note_fields = function(note_id) end end -ankiconnect.append_media = function(note_id, audio_filename, snapshot_filename) +ankiconnect.append_media = function(note_id, audio_filename, snapshot_filename, overwrite) -- AnkiConnect will fail to update the note if the Anki Browser is open. -- First, try to close the Anki Browser. -- https://github.com/FooSoft/anki-connect/issues/82