feat(housekeeping): integrate studio operations
CI / check (pull_request) Successful in 38s
CI / release (pull_request) Skipped
CI / deploy (pull_request) Skipped

This commit is contained in:
Simo committed 2026-08-30 15:29:58 +02:00
1 parent 020c06f172
commit 2e95a106e0
36 files changed
+2296 -60

No files matched your search

+6 -2
View File
@@ -104,7 +104,9 @@ export interface RepairEvent {
export async function repairMissingIcons(
onEvent?: (evt: RepairEvent) => void,
options?: { signal?: AbortSignal },
): Promise<{ succeeded: number; failed: number; skipped: number }> {
options?.signal?.throwIfAborted();
let succeeded = 0;
let failed = 0;
let skipped = 0;
@@ -204,6 +206,7 @@ export async function repairMissingIcons(
onEvent?.({ type: "started", total });
const processItem = async (classname: string) => {
options?.signal?.throwIfAborted();
// Special items (badges, pets, effects, bots, sticky notes) don't have
// .png icon files to repair. Skip them.
if (dbSkipSet.has(classname)) {
@@ -312,7 +315,7 @@ export async function repairMissingIcons(
targets.iconDir,
fileName,
),
{ maxRetries: 1, validate: "png" },
{ maxRetries: 1, validate: "png", signal: options?.signal },
);
if (dl.ok) {
const icon = await fs.readFile(
@@ -350,7 +353,7 @@ export async function repairMissingIcons(
const dl = await downloadFile(
`${source.nitroBaseUrl}/${classname}.nitro`,
nitroTmp,
{ maxRetries: 1 },
{ maxRetries: 1, signal: options?.signal },
);
if (dl.ok) {
const icon = extractFurniIconPng(await fs.readFile(nitroTmp));
@@ -390,6 +393,7 @@ export async function repairMissingIcons(
};
await runPool(items, REPAIR_CONCURRENCY, async (item, i) => {
options?.signal?.throwIfAborted();
const classname = item.item_name;
const result = await processItem(classname);
if (result.status === "skipped") {