From 84d44f953597741e6c059db3d09cacceb0e389cf Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Mon, 28 Sep 2026 01:20:16 +0200 Subject: [PATCH] Added differienciation for gloves when fetching paint_indexes --- src/skins.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/skins.rs b/src/skins.rs index 9d1d495..04ffe08 100644 --- a/src/skins.rs +++ b/src/skins.rs @@ -260,7 +260,8 @@ pub struct PaintIndexInfo { pub struct PaintQuery { weapon: Uuid, team: Teams, - agent: Option + agent: Option, + gloves: Option } pub async fn list_paint_index( @@ -271,6 +272,10 @@ pub async fn list_paint_index( Some(agent) => agent, None => false }; + let gloves = match paint_query.gloves { + Some(gloves) => gloves, + None => false + }; let paints = if agent { let values = query!("SELECT a.name, a.def_index, a.display, r.color FROM agents a JOIN rarity r ON r.id = a.rarity WHERE a.team=$1", paint_query.team.as_i32()).fetch_all(&pool).await?; values.into_iter().map(|x| PaintIndexInfo { @@ -281,6 +286,8 @@ pub async fn list_paint_index( min_float: 0.0, max_float: 0.0 }).collect() + } else if gloves { + query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE w.category='Gloves'").fetch_all(&pool).await? } else { query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE s.weapon=$1", paint_query.weapon).fetch_all(&pool).await? };