Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/lua/dyn_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local o = {
escape_title = true, -- escape & to && in menu title
max_title_length = 80, -- limit the title length, set to 0 to disable.
max_playlist_items = 20, -- limit the playlist items in submenu, set to 0 to disable.
allow_write_watch_later_config = true, -- allow write watch later config when clicking playlist items.
}
opts.read_options(o)

Expand Down Expand Up @@ -399,14 +400,17 @@ local function update_playlist_menu(menu)
})
end

local write_watch_later_cmd = o.allow_write_watch_later_config
and mp.get_property_bool('save-position-on-quit', false)
and 'write-watch-later-config;' or ''
for id = from, to do
local item = playlist[id]
if item then
local title, ext = build_playlist_title(item, id - 1)
append_menu(submenu, {
title = build_playlist_title(item, id - 1),
shortcut = (ext and ext ~= '') and ext:upper() or nil,
cmd = string.format('playlist-play-index %d', id - 1),
cmd = string.format('%s playlist-play-index %d', write_watch_later_cmd, id - 1),
state = (item.playing or item.current) and { 'checked' } or {},
})
end
Expand Down