feat(catalog): repair missing furniture components with verified status
This commit is contained in:
1 parent
3c24df9b1d
commit
570f3dde44
13 files changed
+438
-164
No files matched your search
@@ -68,3 +68,37 @@ export function compareFurniture(
|
||||
: "present";
|
||||
return { state, fields } as const;
|
||||
}
|
||||
export function furnitureHealth(local: FurnitureInspection) {
|
||||
const missing: string[] = [];
|
||||
if (local.nitro.exists === false) missing.push("Nitro");
|
||||
if (local.icon.exists === false) missing.push("Icon");
|
||||
if (local.furnidataReadable && !local.furnidata.length)
|
||||
missing.push("Furnidata");
|
||||
if (!local.sql.length) missing.push("SQL item");
|
||||
if (!local.catalog.length) missing.push("Catalog offer");
|
||||
const sql = local.sql[0],
|
||||
fd = local.furnidata[0];
|
||||
const conflict =
|
||||
local.sql.length > 1 ||
|
||||
local.furnidata.length > 1 ||
|
||||
!!(
|
||||
sql &&
|
||||
fd &&
|
||||
(sql.spriteId !== fd.id ||
|
||||
(sql.type === "i" ? "wallitem" : "flooritem") !== fd.type)
|
||||
);
|
||||
const unknown =
|
||||
!local.furnidataReadable ||
|
||||
local.nitro.exists === null ||
|
||||
local.icon.exists === null;
|
||||
const state = conflict
|
||||
? "conflict"
|
||||
: unknown
|
||||
? "unknown"
|
||||
: !missing.length
|
||||
? "complete"
|
||||
: missing.length === 5
|
||||
? "new"
|
||||
: "incomplete";
|
||||
return { state, missing } as const;
|
||||
}
|
||||
Reference in new issue
Block a user