romm-mcp: restore library scans via POST /api/tasks/scan #20

Merged
hermes-agent merged 1 commits from fix/romm-scan-endpoint into main 2026-11-02 13:56:17 +01:00
2 changed files with 25 additions and 0 deletions
Showing only changes of commit 106bf1014e - Show all commits

No files matched your search

+6
View File
@@ -22,6 +22,12 @@ buildNpmPackage rec {
postPatch = ''
cp ${./package-lock.json} package-lock.json
# romm_system action=scan was stubbed out client-side ("Scan endpoint removed in
# RomM 5.0"), but RomM 5.4 restored POST /api/tasks/scan, so the stub only blocks a
# working endpoint. Upstream publishes no sources in the npm tarball, so this patches
# the compiled dist/ directly; drop it once upstream restores runScan().
patch -p1 < ${./romm-mcp-scan.patch}
'';
# dist/*.js (tsc output) ships inside the npm tarball, so there is nothing to
+19
View File
@@ -0,0 +1,19 @@
--- a/dist/client.js
+++ b/dist/client.js
@@ -244,8 +244,14 @@
// NOTE: RomM 5.0 removed the POST /api/tasks/run endpoint.
// Scans are now managed through RQ workers and require background job management.
// Use the RomM web UI for scans and metadata updates.
- async runScan() {
- throw new Error("Scan endpoint removed in RomM 5.0. Use the RomM web UI to trigger library scans.");
+ async runScan(scanType = "quick") {
+ // RomM 5.4 restored library scans behind POST /api/tasks/scan (ScanPayload:
+ // type, platforms, platform_fs_slugs, roms_ids, apis). The stub above predates
+ // that. "quick" indexes new/changed files; "full" re-hashes the whole library.
+ return this.request("/api/tasks/scan", {
+ method: "POST",
+ body: JSON.stringify({ type: scanType }),
+ });
}
async runMetadataScan() {
throw new Error("Metadata scan endpoint removed in RomM 5.0. Use the RomM web UI to trigger metadata updates.");