Skip to content

Commit 7ab8577

Browse files
dyphiretsl0922
andauthored
fix incorrect track selection status (#63)
* fix incorrect track selection status * update subtitle status --------- Co-authored-by: Shuanglei Tao <[email protected]>
1 parent 21825a1 commit 7ab8577

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lua/dyn_menu.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,19 @@ local function build_track_items(list, type, prop, prefix)
234234
-- filename without extension, escaped for pattern matching
235235
local filename = get('filename/no-ext', ''):gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", "%%%0")
236236
local pos = tonumber(get(prop)) or -1
237+
237238
for _, track in ipairs(list) do
238239
if track.type == type then
239240
local state = {}
240-
-- there may be 2 tracks selected at the same time, for example: subtitle
241-
if track.selected then
241+
if track.selected and track.id == pos then
242242
state[#state + 1] = 'checked'
243-
if track.id ~= pos then state[#state + 1] = 'disabled' end
243+
if type == 'sub' then
244+
if (prop == 'sid' and not get('sub-visibility')) or
245+
(prop == 'secondary-sid' and not get('secondary-sub-visibility'))
246+
then
247+
state[#state + 1] = 'disabled'
248+
end
249+
end
244250
end
245251

246252
items[#items + 1] = {

0 commit comments

Comments
 (0)