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: fe5a6153c429b43415ff80096741b5ceef770483
Parent: fb9a2534d2fd118209edd669b1806b2f2d51b328
Author: Ren Tatsumoto
Date:   Wed, 28 Oct 2020 15:16:16 +0300

allow the user to control what tag is added to new notes

Diffstat:
MREADME.md | 5+++++
Msubs2srs.lua | 4+++-
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -166,6 +166,11 @@ snapshot_height=200 # Size of the font used in the menu menu_font_size=24 + +# The tag that is added to new notes. +# Leave nothing after `=` to disable tagging completely. +note_tag=subs2srs +#note_tag= ``` Sentence field should be first in the note type settings. diff --git a/subs2srs.lua b/subs2srs.lua @@ -52,6 +52,7 @@ local config = { audio_field = "SentAudio", image_field = "Image", menu_font_size = 25, + note_tag = "subs2srs", } local utils = require('mp.utils') @@ -581,6 +582,7 @@ ankiconnect.add_note = function(note_fields, gui) action = 'addNote' end + local tags = is_empty(config.note_tag) and {} or { config.note_tag } local args = { action = action, version = 6, @@ -593,7 +595,7 @@ ankiconnect.add_note = function(note_fields, gui) allowDuplicate = false, duplicateScope = "deck", }, - tags = { "subs2srs" } + tags = tags, } } }