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: faa7b814ca7624a8bf972913fde23e29e0656da4
Parent: b05632b764eb6e2873eba6fd5d7a3049cdcee2a4
Author: Ren Tatsumoto
Date:   Thu, 27 Aug 2020 17:17:05 +0300

dont observe if there are no subs

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

diff --git a/subs2srs.lua b/subs2srs.lua @@ -482,14 +482,13 @@ subs.append = function() end subs.set_starting_point = function() - subs.list = {} - mp.observe_property("sub-text", "string", subs.append) + subs.clear() local current_sub = subs.get_current() if current_sub ~= nil then - local starting_point = current_sub['start'] - starting_point = human_readable_time(starting_point) + local starting_point = human_readable_time(current_sub['start']) + mp.observe_property("sub-text", "string", subs.append) mp.osd_message("Starting point is set to " .. starting_point, 2) else mp.osd_message("There's no visible subtitle.", 2)