fix(search): match disabled packs by all identifiers, not repo URL only
Publish to Comfy registry / Publish Custom Node to registry (push) Has been cancelled

getmappings keys packs by dir name/registry id far more often than by repo
URL, so the url-only join found just 7 of 73 disabled packs (71 nodes).
Resolve each getmappings key against every identifier a pack exposes (dir,
id, cnr_id, aux_id, files) like classifyUnresolved does — now 69 packs /
2301 nodes. Bump to 1.4.1.
This commit is contained in:
2026-06-21 14:38:47 +02:00
parent d8f94ca371
commit 5860b232d4
2 changed files with 30 additions and 20 deletions
+29 -19
View File
@@ -521,33 +521,43 @@ async function fetchManagerInfo() {
} }
} }
// Normalize a repo URL for joining getmappings keys to getlist pack files. // Normalize an identifier (repo URL, dir name, or registry id) for joining
// getmappings keys to getlist packs. Same ordering as classifyUnresolved's norm.
function normalizeRepoUrl(url) { function normalizeRepoUrl(url) {
return String(url || "").trim().toLowerCase().replace(/\.git$/, "").replace(/\/+$/, ""); return String(url || "").trim().replace(/\/+$/, "").replace(/\.git$/i, "").toLowerCase();
} }
// Join Manager's node->pack mappings with the disabled packs from getlist. // Join Manager's node->pack mappings with the disabled packs from getlist.
// mappings: { <repoUrl>: [ [class_type,...], {title_aux} ] } (from getmappings) // mappings: { <packKey>: [ [class_type,...], {title_aux} ] } (from getmappings)
// managerInfo: { <dir>: {id,version,files,state,title?} } (from fetchManagerInfo) // managerInfo: { <dir>: {id,version,files,state,cnr_id,aux_id} } (from fetchManagerInfo)
// Returns [{ class_type, pack, title, info }] for disabled packs only. // getmappings keys come in several forms (dir name, registry id, repo/gist URL),
// and Manager keys the node map by dir/id far more often than by URL — so we
// resolve each key against EVERY identifier a pack exposes, exactly as
// classifyUnresolved does. Matching repo URLs alone misses the vast majority of
// packs. Returns [{ class_type, pack, title, info }] for disabled packs only.
function buildDisabledCatalog(mappings, managerInfo) { function buildDisabledCatalog(mappings, managerInfo) {
const byUrl = {}; const byAnyKey = {};
for (const [url, entry] of Object.entries(mappings || {})) { for (const [dir, info] of Object.entries(managerInfo || {})) {
const list = entry && entry[0]; if (!info) continue;
if (Array.isArray(list)) byUrl[normalizeRepoUrl(url)] = list; const rec = { dir, info };
byAnyKey[normalizeRepoUrl(dir)] = rec;
for (const k of [info.id, info.cnr_id, info.aux_id]) if (k) byAnyKey[normalizeRepoUrl(k)] = rec;
for (const f of (info.files || [])) if (f) byAnyKey[normalizeRepoUrl(f)] = rec;
} }
const catalog = []; const catalog = [];
for (const [dir, info] of Object.entries(managerInfo || {})) { const seen = new Set();
if (!info || info.state !== "disabled") continue; for (const [packKey, entry] of Object.entries(mappings || {})) {
const urls = (info.files && info.files.length ? info.files : [info.repository]).filter(Boolean); const rec = byAnyKey[normalizeRepoUrl(packKey)];
let nodes = null; if (!rec || rec.info.state !== "disabled") continue;
for (const u of urls) { const list = entry && entry[0];
const hit = byUrl[normalizeRepoUrl(u)]; if (!Array.isArray(list)) continue;
if (hit) { nodes = hit; break; } const title = rec.info.title || rec.dir;
for (const ct of list) {
const dedup = rec.dir + "" + ct;
if (seen.has(dedup)) continue;
seen.add(dedup);
catalog.push({ class_type: ct, pack: rec.dir, title, info: rec.info });
} }
if (!nodes) { console.debug("[Node Stats] no node map for disabled pack", dir); continue; }
const title = info.title || dir;
for (const ct of nodes) catalog.push({ class_type: ct, pack: dir, title, info });
} }
return catalog; return catalog;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[project] [project]
name = "comfyui-nodes-stats" name = "comfyui-nodes-stats"
description = "Track usage statistics for all ComfyUI nodes and packages" description = "Track usage statistics for all ComfyUI nodes and packages"
version = "1.4.0" version = "1.4.1"
license = "MIT" license = "MIT"
[project.urls] [project.urls]