diff --git a/src/lib/bridge/handlers/fetch_inspect_info.ts b/src/lib/bridge/handlers/fetch_inspect_info.ts index 748298a8..3c5c3a44 100644 --- a/src/lib/bridge/handlers/fetch_inspect_info.ts +++ b/src/lib/bridge/handlers/fetch_inspect_info.ts @@ -40,6 +40,8 @@ export interface ItemInfo { full_item_name?: string; low_rank?: number; high_rank?: number; + is_souvenir?: boolean; + is_stattrak?: boolean; } export interface FetchInspectInfoRequest { @@ -127,6 +129,8 @@ async function processInspectItem(req: FetchInspectInfoRequest, schema: ItemSche item_name: itemName, rarity_name: rarityName, wear_name: getWearName(floatvalue), + is_souvenir: decoded.quality === 12, + is_stattrak: decoded.killeaterscoretype !== undefined, }; try { diff --git a/src/lib/utils/skin.ts b/src/lib/utils/skin.ts index c6408969..139213f4 100644 --- a/src/lib/utils/skin.ts +++ b/src/lib/utils/skin.ts @@ -74,13 +74,14 @@ enum OrderType { */ function getFloatDbLink(info: ItemInfo, order: OrderType): string { function getFloatDbCategory(item: ItemInfo): number { - if (item.full_item_name?.includes('StatTrak')) { + if (item.is_souvenir == null || item.is_stattrak == null) { + return 0; //unfiltered + } else if (item.is_stattrak) { return 2; - } else if (item.full_item_name?.includes('Souvenir')) { + } else if (item.is_souvenir) { return 3; } else { - // "Normal" - return 1; + return 1; // "Normal"" } } @@ -94,7 +95,7 @@ export function renderClickableRank(info: ItemInfo): TemplateResult<1> { if (!parsedRank) { return html``; } - + return html`