Commit: 448ecf2c221f8d19e8fe40daf2d336ee585fdfe9
Parent: c7383471252d4e1f3dec16a54326928bc69c7049
Author: Ren Tatsumoto
Date: Tue, 9 Mar 2021 11:13:25 +0300
make deck creation on startup toggleable
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/.github/RELEASE/subs2srs.conf b/.github/RELEASE/subs2srs.conf
@@ -2,7 +2,7 @@
# General settings #
####################
-# The deck will be created if it doesn't exist. Subdecks are supported.
+# Anki deck for new cards. Subdecks are supported.
deck_name=Bank::subs2srs
# Model names are listed in `Tools -> Manage note types` menu in Anki.
@@ -25,6 +25,9 @@ menu_font_size=24
# Togglebles. Possble values: `yes` or `no`. #
##############################################
+# Automatically create the deck for new cards (see deck_name option)
+create_deck=yes
+
# When mpv starts, automatically copy subs to the clipboard as they appear on screen.
# This option can be also toggled in the addon's OSD menu.
autoclip=no
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -51,7 +51,8 @@ local config = {
menu_font_size = 25,
-- Anki
- deck_name = "Learning", -- the deck will be created if needed
+ create_deck = false, -- automatically create a deck for new cards
+ deck_name = "Learning", -- name of the deck for new cards
model_name = "Japanese sentences", -- Tools -> Manage note types
sentence_field = "SentKanji",
audio_field = "SentAudio",
@@ -1484,8 +1485,10 @@ do
main = function()
if main_executed then return end
validate_config()
- ankiconnect.create_deck(config.deck_name)
clip_autocopy.init()
+ if config.create_deck == true then
+ ankiconnect.create_deck(config.deck_name)
+ end
-- Key bindings
mp.add_forced_key_binding("ctrl+e", "mpvacious-export-note", export_to_anki)