Fix Windows mpv logging and add log export (#88)

This commit is contained in:
2026-05-26 00:31:38 -07:00
committed by GitHub
parent 43ebc7d371
commit 11c196821d
150 changed files with 2748 additions and 582 deletions
+46 -11
View File
@@ -239,11 +239,21 @@ local ctx = {
},
{
key = {
code = "KeyA",
modifiers = { "alt", "meta" },
code = "KeyD",
modifiers = { "ctrl" },
},
actionType = "session-action",
actionId = "openCharacterDictionary",
actionId = "openCharacterDictionaryManager",
cliArgs = { "--session-action", '{"actionId":"openCharacterDictionaryManager"}' },
},
{
key = {
code = "F12",
modifiers = { "ctrl", "alt" },
},
actionType = "session-action",
actionId = "openFuturePanel",
cliArgs = { "--session-action", '{"actionId":"openFuturePanel"}' },
},
},
}, nil
@@ -357,15 +367,40 @@ local play_next_call = recorded.async_calls[#recorded.async_calls]
assert_true(play_next_call ~= nil, "play-next binding should invoke CLI action")
assert_true(play_next_call[2] == "--play-next-subtitle", "play-next binding should pass CLI flag")
local character_dictionary = find_binding("Alt+Meta+a")
assert_true(character_dictionary ~= nil, "character dictionary binding should be registered")
character_dictionary.fn()
local character_dictionary_call = recorded.async_calls[#recorded.async_calls]
assert_true(character_dictionary_call ~= nil, "character dictionary binding should invoke CLI action")
local character_dictionary_manager = find_binding("Ctrl+d")
assert_true(
character_dictionary_call[2] == "--open-character-dictionary",
"character dictionary binding should pass CLI flag"
character_dictionary_manager ~= nil,
"character dictionary manager binding should be registered"
)
character_dictionary_manager.fn()
local character_dictionary_manager_call = recorded.async_calls[#recorded.async_calls]
assert_true(
character_dictionary_manager_call ~= nil,
"character dictionary manager binding should invoke CLI action"
)
assert_true(
character_dictionary_manager_call[2] == "--session-action",
"character dictionary manager binding should use generic session action CLI flag"
)
assert_true(
character_dictionary_manager_call[3] == '{"actionId":"openCharacterDictionaryManager"}',
"character dictionary manager binding should pass generated session action payload"
)
local future_panel = find_binding("Ctrl+Alt+F12")
assert_true(future_panel ~= nil, "artifact CLI binding should be registered without plugin mapping")
future_panel.fn()
local future_panel_call = recorded.async_calls[#recorded.async_calls]
assert_true(future_panel_call ~= nil, "artifact CLI binding should invoke CLI action")
assert_true(
future_panel_call[2] == "--session-action",
"artifact CLI binding should pass generic session action CLI flag"
)
assert_true(
future_panel_call[3] == '{"actionId":"openFuturePanel"}',
"artifact CLI binding should pass generated session action payload"
)
starter.fn()
+16
View File
@@ -547,6 +547,15 @@ local function has_osd_message(messages, target)
return false
end
local function has_log_containing(logs, target)
for _, message in ipairs(logs) do
if type(message) == "string" and message:find(target, 1, true) then
return true
end
end
return false
end
local function count_osd_message(messages, target)
local count = 0
for _, message in ipairs(messages) do
@@ -2169,6 +2178,13 @@ do
not has_property_set(recorded.property_sets, "pause", true),
"pause-until-ready gate should not arm when socket_path does not match"
)
assert_true(
has_log_containing(
recorded.logs,
"Skipping auto-start: input-ipc-server does not match configured socket_path (expected=/tmp/subminer-socket; active=/tmp/other.sock; matching=no)"
),
"socket mismatch log should include expected and active ipc sockets"
)
end
do