Skip to content

Commit d088e1a

Browse files
committed
pass stored data
1 parent dbf7f7e commit d088e1a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

subs2srs.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,7 @@ local function notify_user_on_finish(note_ids)
438438
end
439439
end
440440

441-
local function make_new_note_data(note_id, new_data, overwrite)
442-
local stored_data = ankiconnect.get_note_fields(note_id)
441+
local function make_new_note_data(stored_data, new_data, overwrite)
443442
if stored_data then
444443
new_data = forvo.append(new_data, stored_data)
445444
new_data = update_sentence(new_data, stored_data)
@@ -462,11 +461,10 @@ end
462461
local function change_fields(note_ids, new_data, overwrite)
463462
--- Run this callback once audio and image files are created.
464463
local change_notes_countdown = dec_counter.new(#note_ids).on_finish(h.as_callback(notify_user_on_finish, note_ids))
465-
466464
for _, note_id in pairs(note_ids) do
467465
ankiconnect.append_media(
468466
note_id,
469-
make_new_note_data(note_id, h.deep_copy(new_data), overwrite),
467+
make_new_note_data(ankiconnect.get_note_fields(note_id), h.deep_copy(new_data), overwrite),
470468
substitute_fmt(config.note_tag),
471469
change_notes_countdown.decrease
472470
)

0 commit comments

Comments
 (0)