feat: inject bundled mpv plugin for managed launches, remove legacy glob (#62)

* feat: inject bundled mpv plugin for managed launches, remove legacy glob

- SubMiner-managed launcher and Windows shortcut launches inject the bundled plugin when no global plugin is detected
- First-run setup detects and removes legacy global plugin files via OS trash before managed playback starts
- Makefile `install-plugin` target and Windows config-rewrite script removed; Linux/macOS install now copies plugin to app data dir
- AniList stats search and post-watch tracking now go through the shared rate limiter
- Stats cover-art lookup reuses cached AniList data before issuing a new request
- Closing mpv in a launcher-managed session now terminates the background Electron app

* harden bootstrap version load and clean plugin on uninstall

- Use pcall for version.lua in bootstrap.lua so missing version module does not crash plugin startup
- Remove plugin/subminer from app-data dirs in uninstall-linux and uninstall-macos targets
- Add Lua compat test asserting bootstrap uses defensive pcall for version load
- Add release-workflow test asserting uninstall targets clean bundled plugin dirs
- Delete completed planning document
This commit is contained in:
2026-05-12 23:11:19 -07:00
committed by GitHub
parent e5c1135501
commit 7c9b65db8b
43 changed files with 2116 additions and 481 deletions
+9
View File
@@ -1,6 +1,8 @@
local MODULE_PATHS = {
"plugin/subminer/bootstrap.lua",
"plugin/subminer/hover.lua",
"plugin/subminer/environment.lua",
"plugin/subminer/version.lua",
}
local LEGACY_PARSER_CANDIDATES = {
@@ -48,6 +50,12 @@ local function assert_loadfile_ok(path)
assert_true(chunk ~= nil, "loadfile failed for " .. path .. ": " .. tostring(err))
end
local function assert_bootstrap_uses_defensive_version_load()
local source = read_file("plugin/subminer/bootstrap.lua")
assert_true(not source:find('require%("version"%)'), "bootstrap.lua must not hard-require version.lua")
assert_true(source:find('pcall%(require, "version"%)') ~= nil, "bootstrap.lua must load version.lua with pcall")
end
local function normalize_execute_result(ok, why, code)
if type(ok) == "number" then
return ok == 0, ok
@@ -128,6 +136,7 @@ for _, path in ipairs(MODULE_PATHS) do
assert_no_legacy_incompatible_continue(path)
assert_loadfile_ok(path)
end
assert_bootstrap_uses_defensive_version_load()
local parser = find_legacy_parser()
if parser then