Skip to content

Commit

Permalink
Update mpv-sub_not_forced_not_sdh.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
pzim-devdata authored Sep 7, 2023
1 parent 672159a commit 4e39d07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mpv-sub_not_forced_not_sdh.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function select_not_forced_subtitle()
local last_sub = nil
for i, sub in ipairs(mp.get_property_native("track-list")) do
if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH")) then
if sub.type == "sub" and not sub.forced and (sub.title == nil or not sub.title:find("SDH") and not string.lower(sub.title):find("force")) then
last_sub = sub
end
end
if last_sub then
mp.set_property("sid", tostring(last_sub.id))
mp.set_property("sid", last_sub.id)
end
end
mp.register_event("file-loaded", select_not_forced_subtitle)

0 comments on commit 4e39d07

Please sign in to comment.