Update the Aniimo catalog and regional filters
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 18m8s
Validate and deploy Sokko G / deploy (push) Successful in 9s

This commit is contained in:
Shinuwa 2026-10-30 00:03:04 +01:00
parent c08452d5a4
commit ae10661b63
62 changed files with 2799 additions and 130 deletions

View file

@ -16,9 +16,11 @@ export function validateAniimoData(aniimos, dictionaries) {
}
for (const aniimo of aniimos) {
assert.match(aniimo.id, /^\d+$/);
assert.ok(!ids.has(aniimo.id), `Duplicate Aniimo id: ${aniimo.id}`);
translated(aniimo.region);
assert.equal(aniimo.uid, `${aniimo.region}:${aniimo.id}`, "Aniimo uid must combine region and id");
assert.ok(!ids.has(aniimo.uid), `Duplicate Aniimo uid: ${aniimo.uid}`);
assert.ok(!names.has(aniimo.name), `Duplicate Aniimo name: ${aniimo.name}`);
ids.add(aniimo.id);
ids.add(aniimo.uid);
names.add(aniimo.name);
translated(aniimo.name);
assert.ok(Array.isArray(aniimo.variations) && aniimo.variations.length > 0);
@ -31,7 +33,17 @@ export function validateAniimoData(aniimos, dictionaries) {
assert.ok(!forms.has(variation.form), `Duplicate form: ${aniimo.name}/${variation.form}`);
forms.add(variation.form);
translated(variation.form);
translated(variation.role);
if (variation.role === null) {
assert.ok(variation.verification === "pending" && variation.data_gaps?.includes("role_not_verified"), "Unknown role must be explicitly pending verification");
} else translated(variation.role);
if (Object.hasOwn(variation, "image")) assert.equal(variation.image, null, "Only a missing portrait may override the standard image path");
if (Object.hasOwn(variation, "verification")) assert.ok(["partial", "pending", "confirmed"].includes(variation.verification), "Invalid verification status");
if (Object.hasOwn(variation, "data_gaps")) {
assertStringArray(variation, "data_gaps");
assert.ok(["partial", "pending"].includes(variation.verification), "Data gaps require a partial or pending verification");
const gaps = ["homeland_abilities_not_verified", "attributes_not_verified", "elements_not_verified", "role_not_verified", "additional_forms_not_verified"];
assert.ok(variation.data_gaps.every((gap) => gaps.includes(gap)), "Unknown data gap");
}
assertStringArray(variation, "elements");
assert.equal(new Set(variation.elements).size, variation.elements.length);
variation.elements.forEach(translated);
@ -137,6 +149,10 @@ export function validateSiteContent(site) {
"aniimo.searchPlaceholder",
"aniimo.prismanaOnly",
"aniimo.prismana",
"aniimo.regions",
"aniimo.unknownRole",
"aniimo.portraitUnavailable",
"aniimo.unverifiedData",
"aniimo.elements",
"aniimo.roles",
"aniimo.role",