Commit: 6472e303c9e98cf94b0c39d2b995c79ea2072346
Parent: e99c043b794291375e9bb0b067d44f32584a4cb8
Author: Ren Tatsumoto
Date: Tue, 8 Sep 2020 05:29:38 +0300
attempt to fix weird race conditions
Diffstat:
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -510,13 +510,7 @@ ankiconnect.append_media = function(note_id, audio_filename, snapshot_filename)
-- Ankiconnet 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
- mp.commandv("run",
- "xdotool",
- "search",
- "--name",
- "Browse \\([0-9]{1,} cards shown; [0-9]{1,} selected\\)",
- "key",
- "Escape")
+ os.execute([[xdotool search --name 'Browse \([0-9]{1,} cards? shown; [0-9]{1,} selected\)' key Escape]])
local args = {
action = "updateNoteFields",