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: cf59180dabd739d449a3db1cbe9192a8c14ba0b3
Parent: 66e9e6fb1a01c2e212b00fbfd9130c563215a2b0
Author: Ren Tatsumoto
Date:   Sun,  9 Aug 2020 07:24:48 +0300

readability

Diffstat:
Msubs2srs.lua | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/subs2srs.lua b/subs2srs.lua @@ -15,7 +15,7 @@ -- * ankiconnect config = { - collection_path = os.getenv("HOME") .. '/.local/share/Anki2/' .. os.getenv("USER") .. '/collection.media/', + collection_path = string.format('%s/.local/share/Anki2/%s/collection.media/', os.getenv("HOME"), os.getenv("USER")), autoclip = false, -- copy subs to the clipboard or not nuke_spaces = true, -- remove all spaces or not human_readable_time = true, -- use seconds if false @@ -160,11 +160,12 @@ function construct_filename(sub) filename = remove_text_in_brackets(filename) filename = remove_special_characters(filename) - filename = filename - .. '_' - .. format_time(sub['start']) - .. '-' - .. format_time(sub['end']) + filename = string.format( + '%s_(%s-%s)', + filename, + format_time(sub['start']), + format_time(sub['end']) + ) return filename end