From 1167a483448840754270766abdb312eb97e839ab Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 3 Aug 2026 21:39:27 +0200 Subject: [PATCH] fix: use badge icon file pattern to exclude badge items from audit and repair Previously identified badge items by interaction_type='badge', but clone-imported badges have interaction_type='default'. Now checks for badge__icon.png file existence instead. --- src/lib/services/catalog-audit.ts | 8 +++----- src/lib/services/repair-nitros.ts | 17 +++++------------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/lib/services/catalog-audit.ts b/src/lib/services/catalog-audit.ts index eaafa83b80..b0d999941e 100644 --- a/src/lib/services/catalog-audit.ts +++ b/src/lib/services/catalog-audit.ts @@ -154,18 +154,16 @@ export async function runCatalogAudit( item_name: string; public_name: string; type: string; - interaction_type: string; }>; try { const [rows] = (await db.execute(sql` - SELECT id, item_name, public_name, type, interaction_type FROM items_base ORDER BY id + SELECT id, item_name, public_name, type FROM items_base ORDER BY id `)) as unknown as [ Array<{ id: number; item_name: string; public_name: string; type: string; - interaction_type: string; }>, unknown, ]; @@ -246,7 +244,7 @@ export async function runCatalogAudit( // entry for a furni without a bundle would be un-placeable in-game. // Badge items use .gif files, not .nitro bundles. if ( - item.interaction_type !== "badge" && + !iconSet.has(`badge_${item.item_name}_icon.png`) && nitroSet.has(`${item.item_name}.nitro`) ) { missingCatalogEntries.push({ @@ -318,7 +316,7 @@ export async function runCatalogAudit( for (let i = 0; i < items.length; i++) { const item = items[i]; // Badge items use .gif files, not .nitro bundles. - if (item.interaction_type === "badge") continue; + if (iconSet.has(`badge_${item.item_name}_icon.png`)) continue; if (!nitroSet.has(`${item.item_name}.nitro`)) { missingNitroClassnames.push(item.item_name); issues.push({ diff --git a/src/lib/services/repair-nitros.ts b/src/lib/services/repair-nitros.ts index 235f74a36d..8717402de6 100644 --- a/src/lib/services/repair-nitros.ts +++ b/src/lib/services/repair-nitros.ts @@ -136,14 +136,11 @@ export async function repairMissingNitros( ...targets.mirrorDirs.map((d) => d.nitroDir), ]); - let items: Array<{ id: number; item_name: string; interaction_type: string }>; + let items: Array<{ id: number; item_name: string }>; try { const [rows] = (await db.execute(sql` - SELECT id, item_name, interaction_type FROM items_base ORDER BY id - `)) as unknown as [ - Array<{ id: number; item_name: string; interaction_type: string }>, - unknown, - ]; + SELECT id, item_name FROM items_base ORDER BY id + `)) as unknown as [Array<{ id: number; item_name: string }>, unknown]; items = rows; } catch (err) { onEvent?.({ @@ -156,11 +153,7 @@ export async function repairMissingNitros( const total = items.length; onEvent?.({ type: "started", total }); - const processItem = async (classname: string, interactionType: string) => { - // Badge items use .gif files, not .nitro bundles. - if (interactionType === "badge") { - return { status: "skipped" } as const; - } + const processItem = async (classname: string) => { const fileName = `${classname}.nitro`; const presentDirs = nitroDirs.filter((dir) => @@ -266,7 +259,7 @@ export async function repairMissingNitros( await runPool(items, REPAIR_CONCURRENCY, async (item, i) => { const classname = item.item_name; - const result = await processItem(classname, item.interaction_type); + const result = await processItem(classname); if (result.status === "skipped") { skipped++; onEvent?.({