Exclude derived scene thumbnails from orphan findings

This commit is contained in:
2026-04-21 13:03:08 +00:00
parent b9161f219e
commit 7d299b31fe
3 changed files with 37 additions and 1 deletions

View File

@@ -211,6 +211,7 @@ function wildcardToRegExp(pattern) {
}
function shouldReportOrphan(file, references) {
if (isDerivedSceneThumbnail(file)) return false;
if (file.riskClass === "stable-world") {
const worldId = file.ownerHint.ownerId;
return references.some(reference => reference.sourceScope?.ownerType === "world" && reference.sourceScope.ownerId === worldId);
@@ -224,6 +225,11 @@ function shouldReportOrphan(file, references) {
return false;
}
function isDerivedSceneThumbnail(file) {
const path = String(file.path ?? "");
return /^worlds\/[^/]+\/assets\/scenes\/[^/]+-thumb\.(?:png|webp)$/u.test(path);
}
export function createFileRecord(locator, size = null) {
return {
...locator,