Skip to content

Commit 97dbcb3

Browse files
rainerstudiosclaude
andcommitted
Simplify image handling - API now returns working URLs
- API integrated CSGO-API database (2,013 skins) with working image URLs - Removed client-side URL transformation logic - Now just use API's imageurl directly with fallback to placeholder - Cleaner, simpler, and more reliable Fixes: Image URLs now work for all 2,013 CS2 skins 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b955258 commit 97dbcb3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

background.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -488,22 +488,22 @@ async function fetchFloatData(inspectLink) {
488488
}
489489

490490
/**
491-
* Build working Steam CDN image URL using item metadata
492-
* @param {string} oldImageUrl - Old imageurl from API (not used, kept for compatibility)
493-
* @param {number} defindex - Weapon definition index
494-
* @param {number} paintindex - Paint/skin index
491+
* Build image URL array with fallback
492+
* API now returns working URLs from CSGO-API database (2,013 skins)
493+
* @param {string} apiImageUrl - Working imageurl from API
494+
* @param {number} defindex - Weapon definition index (unused, kept for compatibility)
495+
* @param {number} paintindex - Paint/skin index (unused, kept for compatibility)
495496
* @returns {Array<string>} Array of image URLs to try in order
496497
*/
497-
function buildImageUrl(oldImageUrl, defindex, paintindex) {
498+
function buildImageUrl(apiImageUrl, defindex, paintindex) {
498499
const urls = [];
499500

500-
// Option 1: Use Steam's economy/image API with defindex/paintindex (most reliable)
501-
if (defindex && paintindex) {
502-
urls.push(`https://community.akamai.steamstatic.com/economy/image/class/730/${defindex}/${paintindex}`);
503-
urls.push(`https://community.cloudflare.steamstatic.com/economy/image/class/730/${defindex}/${paintindex}`);
501+
// API now returns working URLs from CSGO-API integration
502+
if (apiImageUrl) {
503+
urls.push(apiImageUrl);
504504
}
505505

506-
// Option 2: Generic CS2 placeholder (always works as fallback)
506+
// Generic CS2 placeholder as fallback
507507
urls.push('https://community.cloudflare.steamstatic.com/economy/image/fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZYMUrsm1j-9xgEAaR4uURrwvz0N252yVaDVWrRTno9m4ccG2GNqxlQoZrC2aG9hcVGUWflbX_drrVu5UGki5sAij6tOtQ/360fx360f');
508508

509509
return urls;

0 commit comments

Comments
 (0)