fix(nx-mods): skip MTP AppleDouble zips and mount archives in memory

Mac OpenMTP leaves ._*.zip sidecars that fail PhysFS mount and hide a good install; prefer FileData mount on Horizon and keep success notices when a sibling fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-01 05:53:48 -03:00
parent 2223c31e93
commit 3aefe41ea1
4 changed files with 86 additions and 23 deletions
+13
View File
@@ -197,6 +197,19 @@ check(not removed["imports/mods/a-bad.zip"], "mixed: bad zip retained")
check(not removed["imports/mods/b-good.zip"], "mixed: good zip retained")
check(love.filesystem.read("imports/mods/a-bad.zip") ~= nil, "mixed bad still present")
check(love.filesystem.read("imports/mods/b-good.zip") ~= nil, "mixed good still present")
check(ri.modNotice and ri.modNotice.ok, "mixed prefers success notice over sibling fail")
-- Mac MTP AppleDouble (._*.zip) must not be install candidates
ri = freshImporter()
installCalls = {}
love.filesystem.write("imports/mods/._DRAMATIC_SHAPE-1.4.0.zip", "APPL")
love.filesystem.write("imports/mods/DRAMATIC_SHAPE-1.4.0.zip", "GOOD")
installBehavior["imports/mods/DRAMATIC_SHAPE-1.4.0.zip"] = { ok = true, id = "dramatic_shape" }
ri:rescanModsAction()
eq(#installCalls, 1, "AppleDouble ._*.zip is skipped")
eq(installCalls[1], "imports/mods/DRAMATIC_SHAPE-1.4.0.zip",
"only the real zip is installed")
check(ri.modNotice and ri.modNotice.ok, "AppleDouble skip still shows install success")
-- NXMOD-05: chooseMod on NX routes to inbox rescan; no HostShell/chooseZip
local hostShellCalls = 0