Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/bridge/handlers/fetch_inspect_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
11 changes: 6 additions & 5 deletions src/lib/utils/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +77 to +78

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check necessary? Applying the "normal" category should work for non-skins as well afaik

} 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""
}
}

Expand All @@ -94,7 +95,7 @@ export function renderClickableRank(info: ItemInfo): TemplateResult<1> {
if (!parsedRank) {
return html``;
}

return html` <a
style="color: #ebebeb; text-decoration: none; cursor: pointer;"
href="${getFloatDbLink(info, parsedRank.order)}"
Expand Down
Loading