fix: use badge icon file pattern to exclude badge items from audit and repair
CI / check (push) Successful in 28s
CI / release (push) Skipped
CI / deploy (push) Successful in 55s

Previously identified badge items by interaction_type='badge', but
clone-imported badges have interaction_type='default'. Now checks for
badge_<code>_icon.png file existence instead.
This commit is contained in:
openhands committed 2026-08-03 21:39:27 +02:00
1 parent 40da24bd8c
commit 1167a48344
2 files changed
+8 -17

No files matched your search

+5 -12
View File
@@ -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?.({