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: 40658f503d884430cd517f402136b6904fc92764
Parent: cf59180dabd739d449a3db1cbe9192a8c14ba0b3
Author: Ren Tatsumoto
Date:   Mon, 17 Aug 2020 03:42:25 +0300

bugfix

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

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