Fix menu item values for UOSC compatibility

- Convert array-format values to proper command strings
- UOSC expects string commands like 'script-message medios-load-url'
- Add main menu close before opening Load URL prompt
- Ensure menu items are properly formatted for UOSC execution
This commit is contained in:
2026-02-03 18:43:54 -08:00
parent 8e56109215
commit 011c8d9a4c

View File

@@ -2731,6 +2731,11 @@ end)
mp.register_script_message('medios-load-url', function()
_lua_log('medios-load-url handler called')
-- Close the main menu first
if ensure_uosc_loaded() then
_lua_log('medios-load-url: closing main menu before opening Load URL prompt')
mp.commandv('script-message-to', 'uosc', 'close-menu')
end
M.open_load_url_prompt()
end)
@@ -2837,18 +2842,19 @@ function M.show_menu()
_lua_log('[MENU] M.show_menu called')
-- Build menu items
-- Note: UOSC expects command strings, not arrays
local items = {
{ title = "Load URL", value = {"script-message-to", mp.get_script_name(), "medios-load-url"} },
{ title = "Load URL", value = "script-message medios-load-url" },
{ title = "Get Metadata", value = "script-binding medios-info", hint = "Ctrl+i" },
{ title = "Delete File", value = "script-binding medios-delete", hint = "Ctrl+Del" },
{ title = "Cmd", value = {"script-message-to", mp.get_script_name(), "medios-open-cmd"}, hint = "screenshot/trim/etc" },
{ title = "Download", value = {"script-message-to", mp.get_script_name(), "medios-download-current"} },
{ title = "Change Format", value = {"script-message-to", mp.get_script_name(), "medios-change-format-current"} },
{ title = "Cmd", value = "script-message medios-open-cmd", hint = "screenshot/trim/etc" },
{ title = "Download", value = "script-message medios-download-current" },
{ title = "Change Format", value = "script-message medios-change-format-current" },
}
-- Conditionally add "Start Helper" if not running
if not _is_pipeline_helper_ready() then
table.insert(items, { title = "Start Helper", hint = "(pipeline actions)", value = {"script-message-to", mp.get_script_name(), "medios-start-helper"} })
table.insert(items, { title = "Start Helper", hint = "(pipeline actions)", value = "script-message medios-start-helper" })
end
_lua_log('[MENU] Built ' .. #items .. ' menu items')