feat(nx-mods): scan imports/mods for zip candidates

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-01 05:19:59 -03:00
parent 7d01242cd1
commit d4455c508f
2 changed files with 44 additions and 0 deletions
+18
View File
@@ -398,6 +398,18 @@ local function listRomPaths(dir)
return paths
end
local function listZipPaths(dir)
local paths = {}
for _, name in ipairs(love.filesystem.getDirectoryItems(dir) or {}) do
local path = (dir == "" or dir == "/") and name or (dir .. "/" .. name)
if name:lower():match("%.zip$")
and love.filesystem.getInfo(path, "file") then
paths[#paths + 1] = path
end
end
return paths
end
function RomImporter:scanInbox(ready)
ready = ready or self.ready
local paths = {}
@@ -411,6 +423,12 @@ function RomImporter:scanInbox(ready)
return paths
end
-- NX mods inbox: only *.zip under imports/mods/ (never ROM extensions).
function RomImporter:scanModsInbox()
self:ensureModsInboxDir()
return listZipPaths(MODS_INBOX_DIR)
end
function RomImporter:rescanAction(version)
if self.workState == "working" then return end
version = version or self.tab or "red"