summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2022-08-17 22:16:33 +0200
committerDudemanguy <random342@airmail.cc>2022-09-23 19:18:49 +0000
commitac7f3913d3bb0f8f252e0f8877b76e4322a6be47 (patch)
tree20dbb83ee32c5e1be1ec351a6af9ee4025c3da07 /player/lua
parentf46bbde5e62243e284da2ff051e7f245ce2901a8 (diff)
downloadmpv-ac7f3913d3bb0f8f252e0f8877b76e4322a6be47.tar.bz2
mpv-ac7f3913d3bb0f8f252e0f8877b76e4322a6be47.tar.xz
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.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/ytdl_hook.lua3
1 files changed, 2 insertions, 1 deletions
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