ytdl_hook: use subtitle `name` as title if available

So far the `ext` was always used as the title,
but `name` is more appropriate when it's available.
This commit is contained in:
Christoph Heinrich 2022-08-17 22:16:33 +02:00 committed by Dudemanguy
parent f46bbde5e6
commit ac7f3913d3
1 changed files with 2 additions and 1 deletions

View File

@ -658,7 +658,8 @@ local function add_single_video(json)
edl = edl .. ",codec=" .. codec
end
edl = edl .. ";" .. edl_escape(sub)
mp.commandv("sub-add", edl, "auto", sub_info.ext, lang)
local title = sub_info.name or sub_info.ext
mp.commandv("sub-add", edl, "auto", title, lang)
else
msg.verbose("No subtitle data/url for ["..lang.."]")
end