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:
parent
1ef05adce4
commit
2929c3373e
2 changed files with 2 additions and 4 deletions
|
@ -595,9 +595,7 @@ const resolvers = {
|
||||||
// TODO: We could query for this more directly, instead of loading all
|
// TODO: We could query for this more directly, instead of loading all
|
||||||
// appearances 🤔
|
// appearances 🤔
|
||||||
const petStates = await petStatesForPetTypeLoader.load(petType.id);
|
const petStates = await petStatesForPetTypeLoader.load(petType.id);
|
||||||
const petState = petStates.find(
|
const petState = petStates.find((ps) => getPoseFromPetState(ps) === pose);
|
||||||
(ps) => getPoseFromPetState(ps) === pose && !ps.glitched
|
|
||||||
);
|
|
||||||
if (!petState) {
|
if (!petState) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,7 +356,7 @@ const buildPetStatesForPetTypeLoader = (db, loaders) =>
|
||||||
`SELECT * FROM pet_states
|
`SELECT * FROM pet_states
|
||||||
WHERE pet_type_id IN (${qs})
|
WHERE pet_type_id IN (${qs})
|
||||||
ORDER BY (mood_id IS NULL) ASC, mood_id ASC, female DESC,
|
ORDER BY (mood_id IS NULL) ASC, mood_id ASC, female DESC,
|
||||||
unconverted DESC, id DESC`,
|
unconverted DESC, glitched ASC, id DESC`,
|
||||||
petTypeIds
|
petTypeIds
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue