fix: rebuild asset sets after repair to accurately report stillMissing
This commit is contained in:
1 parent
00b5a6f5c3
commit
af8aaaa512
1 file changed
+20
-2
@@ -183,8 +183,8 @@ export async function runCatalogAudit(
|
||||
}
|
||||
})(),
|
||||
]);
|
||||
const iconSet = new Set(iconFiles);
|
||||
const nitroSet = new Set(nitroFiles);
|
||||
let iconSet = new Set(iconFiles);
|
||||
let nitroSet = new Set(nitroFiles);
|
||||
// Badge detection: `items_base.type = 'b'` is authoritative. The album1584
|
||||
// `.gif` listing is kept as a fallback for hotels that store badges with a
|
||||
// non-standard type.
|
||||
@@ -466,6 +466,15 @@ export async function runCatalogAudit(
|
||||
}
|
||||
});
|
||||
|
||||
// Re-read directories so the set reflects files written
|
||||
// by the repair pass.
|
||||
const [repairedIconFiles, repairedNitroFiles] = await Promise.all([
|
||||
readdir(iconDir).catch(() => [] as string[]),
|
||||
readdir(nitroDir).catch(() => [] as string[]),
|
||||
]);
|
||||
iconSet = new Set(repairedIconFiles);
|
||||
nitroSet = new Set(repairedNitroFiles);
|
||||
|
||||
// Re-check which of the previously-missing icons are still missing
|
||||
// and drop the ones the repair fixed from the issue list. The ones
|
||||
// left over cannot be restored from any source → legacy/broken.
|
||||
@@ -530,6 +539,15 @@ export async function runCatalogAudit(
|
||||
}
|
||||
});
|
||||
|
||||
// Re-read directories so the set reflects files written
|
||||
// by the repair pass.
|
||||
const [repairedIconFiles2, repairedNitroFiles2] = await Promise.all([
|
||||
readdir(iconDir).catch(() => [] as string[]),
|
||||
readdir(nitroDir).catch(() => [] as string[]),
|
||||
]);
|
||||
iconSet = new Set(repairedIconFiles2);
|
||||
nitroSet = new Set(repairedNitroFiles2);
|
||||
|
||||
// Re-check which of the previously-missing nitros are still missing
|
||||
// and drop the ones the repair fixed from the issue list. The ones
|
||||
// left over cannot be restored from any source → legacy/broken.
|
||||
|
||||
Reference in new issue
Block a user