Commit: 75d78aa3940105aa1dd1b66c778c69b059d20fdf
Parent: 7cbe7f8768115b5945d77cf7afc324d4b0fd888b
Author: Ren Tatsumoto
Date: Tue, 16 Nov 2021 23:45:14 +0300
allow adding subs even if no text can be fetched
can be used to mine from pgs subs
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -1298,7 +1298,7 @@ end
subs.set_starting_line = function()
subs.clear()
- if not is_empty(mp.get_property("sub-text")) then
+ if subs.get_current() then
subs.observe()
notify("Timings have been set to the current sub.", "info", 2)
else
@@ -1380,8 +1380,9 @@ end
function Subtitle:now()
local delay = mp.get_property_native("sub-delay") - mp.get_property_native("audio-delay")
+ local text = mp.get_property("sub-text")
local this = self:new {
- ['text'] = mp.get_property("sub-text"),
+ ['text'] = not is_empty(text) and text or "<PGS subtitles>",
['start'] = mp.get_property_number("sub-start"),
['end'] = mp.get_property_number("sub-end"),
}