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_<code>_icon.png file existence instead.
This commit is contained in:
1 parent
40da24bd8c
commit
1167a48344
2 files changed
+8
-17
No files matched your search
@@ -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({
|
||||
|
||||
@@ -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?.({
|
||||
|
||||
Reference in new issue
Block a user