Manually disambiguate Butterfly Dress from ~owls
There are two Neopets NC items named Butterfly Dress! ~owls disambiguates them by calling one of them "Butterfly Dress (from Faerie Festival event)". It'd be a bit more robust to cooperate with ~owls t o get item IDs served up in this case, but it's not a big deal esp. for only this one case, so like… this is fine!
This commit is contained in:
parent
5dde7764e2
commit
41efe05be4
1 changed files with 12 additions and 2 deletions
|
@ -92,13 +92,23 @@ async function loadOWLSValuesByIdOrName() {
|
||||||
// if it does! (I'm keeping the rest of the code the same because I
|
// if it does! (I'm keeping the rest of the code the same because I
|
||||||
// think that might happen for disambiguation, like Waka did.) Until
|
// think that might happen for disambiguation, like Waka did.) Until
|
||||||
// then, we just always key by name.
|
// then, we just always key by name.
|
||||||
const normalizedItemName = normalizeItemName(itemName);
|
// HACK: With the exception of the Butterfly Dress, which has a special
|
||||||
|
// name in the OWLS database! We hardcodily disambiguate it here. But
|
||||||
|
// if they start serving item IDs, that would resolve it too!
|
||||||
|
let nameOrId;
|
||||||
|
if (itemName === "Butterfly Dress") {
|
||||||
|
nameOrId = 44775;
|
||||||
|
} else if (itemName === "Butterfly Dress (from Faerie Festival event)") {
|
||||||
|
nameOrId = 76073;
|
||||||
|
} else {
|
||||||
|
nameOrId = normalizeItemName(itemName);
|
||||||
|
}
|
||||||
|
|
||||||
// We wrap it in an object with the key `valueText`, just to not break
|
// We wrap it in an object with the key `valueText`, just to not break
|
||||||
// potential external consumers of this endpoint if we add more fields.
|
// potential external consumers of this endpoint if we add more fields.
|
||||||
// (This is kinda silly and unnecessary, but it should get gzipped out and
|
// (This is kinda silly and unnecessary, but it should get gzipped out and
|
||||||
// shouldn't add substantial time to building or parsing, so like w/e!)
|
// shouldn't add substantial time to building or parsing, so like w/e!)
|
||||||
itemValuesByIdOrName[normalizedItemName] = { valueText };
|
itemValuesByIdOrName[nameOrId] = { valueText };
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemValuesByIdOrName;
|
return itemValuesByIdOrName;
|
||||||
|
|
Loading…
Reference in a new issue