prefer nicer pet states

This commit is contained in:
Matt Dunn-Rankin 2020-04-25 04:43:54 -07:00
parent 77568c7a2f
commit bed3cf7227
2 changed files with 9 additions and 14 deletions

View file

@ -305,22 +305,15 @@ describe("PetAppearance", () => {
}, },
}, },
Object { Object {
"id": "19549", "id": "19784",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/028/28548/600x600.png?v2-1345719457000", "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/028/28892/600x600.png?v2-1313418652000",
"zone": Object { "zone": Object {
"depth": 37, "depth": 37,
}, },
}, },
Object { Object {
"id": "19550", "id": "178150",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/028/28549/600x600.png?v2-0", "imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/036/36887/600x600.png?v2-1354240708000",
"zone": Object {
"depth": 38,
},
},
Object {
"id": "163528",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/biology/000/000/028/28549/600x600.png?v2-1326455337000",
"zone": Object { "zone": Object {
"depth": 38, "depth": 38,
}, },
@ -339,7 +332,8 @@ describe("PetAppearance", () => {
], ],
], ],
Array [ Array [
"SELECT * FROM pet_states WHERE pet_type_id IN (?)", "SELECT * FROM pet_states WHERE pet_type_id IN (?)
ORDER BY glitched ASC, (mood_id = 1) DESC",
Array [ Array [
"2", "2",
], ],
@ -351,7 +345,7 @@ describe("PetAppearance", () => {
rel.swf_asset_id = sa.id rel.swf_asset_id = sa.id
WHERE rel.parent_id IN (?)", WHERE rel.parent_id IN (?)",
Array [ Array [
"2", "17723",
], ],
], ],
Array [ Array [

View file

@ -229,7 +229,8 @@ const buildPetStateLoader = (db) =>
new DataLoader(async (petTypeIds) => { new DataLoader(async (petTypeIds) => {
const qs = petTypeIds.map((_) => "?").join(","); const qs = petTypeIds.map((_) => "?").join(",");
const [rows, _] = await db.execute( const [rows, _] = await db.execute(
`SELECT * FROM pet_states WHERE pet_type_id IN (${qs})`, `SELECT * FROM pet_states WHERE pet_type_id IN (${qs})
ORDER BY glitched ASC, (mood_id = 1) DESC`,
petTypeIds petTypeIds
); );