refactor: split mpv plugin into modular script directory

This commit is contained in:
kyasuda
2026-02-24 18:02:57 -08:00
parent 3da9d9e0e0
commit 60cd1c8ac2
23 changed files with 2203 additions and 1959 deletions

View File

@@ -0,0 +1,47 @@
local M = {}
function M.load(options_lib, default_socket_path)
local opts = {
binary_path = "",
socket_path = default_socket_path,
texthooker_enabled = true,
texthooker_port = 5174,
backend = "auto",
auto_start = true,
auto_start_overlay = false,
auto_start_visible_overlay = false,
auto_start_invisible_overlay = "platform-default",
osd_messages = true,
log_level = "info",
aniskip_enabled = true,
aniskip_title = "",
aniskip_season = "",
aniskip_mal_id = "",
aniskip_episode = "",
aniskip_show_button = true,
aniskip_button_text = "You can skip by pressing %s",
aniskip_button_key = "y-k",
aniskip_button_duration = 3,
}
options_lib.read_options(opts, "subminer")
return opts
end
function M.coerce_bool(value, fallback)
if type(value) == "boolean" then
return value
end
if type(value) == "string" then
local normalized = value:lower()
if normalized == "yes" or normalized == "true" or normalized == "1" or normalized == "on" then
return true
end
if normalized == "no" or normalized == "false" or normalized == "0" or normalized == "off" then
return false
end
end
return fallback
end
return M