From ac7f3913d3bb0f8f252e0f8877b76e4322a6be47 Mon Sep 17 00:00:00 2001 From: Christoph Heinrich Date: Wed, 17 Aug 2022 22:16:33 +0200 Subject: 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. --- player/lua/ytdl_hook.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/lua') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 0656f01998..57023e224e 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -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 -- cgit v1.2.3