Commit: c7383471252d4e1f3dec16a54326928bc69c7049
Parent: 9c134666aef5fc8f0ea49f0d4094c04efb0b220a
Author: Ren Tatsumoto
Date: Sat, 6 Mar 2021 01:05:43 +0000
Merge pull request #26 from eshrh/append_order
Allow configuration of note update order
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.github/RELEASE/subs2srs.conf b/.github/RELEASE/subs2srs.conf
@@ -41,6 +41,9 @@ tie_volumes=no
# before copying subtitles to the clipboard
clipboard_trim_enabled=yes
+# Add media to fields before or after existing data
+append_media=yes
+
##################
# Image settings #
##################
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -56,7 +56,8 @@ local config = {
sentence_field = "SentKanji",
audio_field = "SentAudio",
image_field = "Image",
- note_tag = "subs2srs", -- the tag that is added to new notes. change to "" to disable tagging
+ note_tag = "subs2srs", -- the tag that is added to new notes. change to "" to disable tagging
+ append_media = true, -- True to append video media after existing data, false to insert media before
-- Forvo support
use_forvo = "yes", -- 'yes', 'no', 'always'
@@ -560,7 +561,11 @@ local function update_last_note(overwrite)
new_data = append_forvo_pronunciation(new_data, stored_data)
new_data = update_sentence(new_data, stored_data)
if not overwrite then
- new_data = join_media_fields(new_data, stored_data)
+ if config.append_media then
+ new_data = join_media_fields(new_data, stored_data)
+ else
+ new_data = join_media_fields(stored_data, new_data)
+ end
end
end