serve glitched appearances, only if no others

Previously, I was filtering out glitched appearances from the canonical ones.

But now, I'm thinking it's better to serve glitched ones than no data for a pose at all.

I'm inspired by the case of the Candy Acara, which has _only_ glitched appearances in our db, and I'd like to mark them for reference—but then the site would treat it as no data at all.
This commit is contained in:
Emi Matchu 2020-08-31 00:37:12 -07:00
parent 1ef05adce4
commit 2929c3373e
2 changed files with 2 additions and 4 deletions

View file

@ -595,9 +595,7 @@ const resolvers = {
// TODO: We could query for this more directly, instead of loading all
// appearances 🤔
const petStates = await petStatesForPetTypeLoader.load(petType.id);
const petState = petStates.find(
(ps) => getPoseFromPetState(ps) === pose && !ps.glitched
);
const petState = petStates.find((ps) => getPoseFromPetState(ps) === pose);
if (!petState) {
return null;
}

View file

@ -356,7 +356,7 @@ const buildPetStatesForPetTypeLoader = (db, loaders) =>
`SELECT * FROM pet_states
WHERE pet_type_id IN (${qs})
ORDER BY (mood_id IS NULL) ASC, mood_id ASC, female DESC,
unconverted DESC, id DESC`,
unconverted DESC, glitched ASC, id DESC`,
petTypeIds
);