From 67e8d6a1f35393e164e0497550b9cc15bb92aa74 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 21 Aug 2020 16:25:04 -0700 Subject: [PATCH] fix support logging body names to not be 8-bit Huh, some 8-bit species are broken and use the standard body ID! This was causing our body name query to prioritize 8-bit for standard assets, as the alphabetically-first compatible color; but 8-bit isn't marked standard, so the function kept it labeled 8-bit. This should fix it and show "Standard Draik" when deleting an asset off the standard draik body! --- src/server/__snapshots__/util.test.js.snap | 10 +++++----- src/server/util.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/__snapshots__/util.test.js.snap b/src/server/__snapshots__/util.test.js.snap index 6f31d7b..d728a10 100644 --- a/src/server/__snapshots__/util.test.js.snap +++ b/src/server/__snapshots__/util.test.js.snap @@ -48,7 +48,7 @@ Array [ ], Array [ "56", - "8-bit Elephante", + "Standard Elephante", ], Array [ "66", @@ -296,7 +296,7 @@ Array [ ], Array [ "132", - "8-bit Draik", + "Standard Draik", ], Array [ "133", @@ -468,7 +468,7 @@ Array [ ], Array [ "175", - "8-bit Kyrii", + "Standard Kyrii", ], Array [ "176", @@ -532,7 +532,7 @@ Array [ ], Array [ "191", - "8-bit Ruki", + "Standard Ruki", ], Array [ "192", @@ -616,7 +616,7 @@ Array [ ], Array [ "212", - "8-bit Chia", + "Standard Chia", ], Array [ "213", diff --git a/src/server/util.js b/src/server/util.js index fc45460..7444740 100644 --- a/src/server/util.js +++ b/src/server/util.js @@ -99,7 +99,7 @@ async function loadBodyName(bodyId, db) { ON pt.color_id = ct.color_id AND ct.locale = "en" INNER JOIN colors c ON c.id = pt.color_id WHERE pt.body_id = ? - ORDER BY ct.name, st.name LIMIT 1;`, + ORDER BY c.standard DESC, ct.name, st.name LIMIT 1;`, [bodyId] ); const row = normalizeRow(rows[0]);