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
11 changes: 9 additions & 2 deletions services/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { $t, languageData } from "./translations.js";
import { state } from "./main.js";
import { getRarityColor } from "../utils/index.js";
import { getImageUrl, getImageUrlSvg } from "../constants.js";
import collectionReleaseDates from "../utils/collectionReleaseDates.json" with { type: "json" };

const SPECIAL_COLLECTIONS = ["#CSGO_set_timed_drops_achroma", "#CSGO_set_timed_drops_exuberant"];

Expand Down Expand Up @@ -58,10 +59,13 @@ const getImage = item => {
const parseItem = item => {
const { skinsByCollections, cratesByCollections } = state;
const { image, image_inventory } = getImage(item);
const id = `collection-${item.name.replace("#CSGO_", "").replace(/_/g, "-")}`;

return {
id: `collection-${item.name.replace("#CSGO_", "").replace(/_/g, "-")}`,
id,
name: item.name_force ? $t(item.name_force) : $t(item.name),
description: $t(item.set_description),
release_date: collectionReleaseDates[id] ?? null,
crates: (cratesByCollections?.[item.name.replace("#CSGO_", "")] ?? []).map(i => ({
...i,
name: $t(i.name),
Expand Down Expand Up @@ -90,10 +94,13 @@ const parseItemSelfOpening = item => {

const image =
cdnImages[item.image_inventory.toLowerCase()] ?? getImageUrl(item.image_inventory.toLowerCase());
const id = `collection-${item.object_id}`;

return {
id: `collection-${item.object_id}`,
id,
name: $t(item.item_name),
description: $t(item.set_description),
release_date: collectionReleaseDates[id] ?? null,
crates: [],
contains: (skinsByCollections?.[item.name] ?? []).map(i => ({
...i,
Expand Down
108 changes: 108 additions & 0 deletions utils/collectionReleaseDates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"collection-set-community-3": "2014-06-11",
"collection-set-weapons-i": "2013-08-14",
"collection-set-esports": "2013-08-14",
"collection-set-bravo-i": "2013-09-20",
"collection-set-weapons-ii": "2013-11-08",
"collection-set-esports-ii": "2013-12-18",
"collection-set-community-1": "2013-12-18",
"collection-set-weapons-iii": "2014-02-12",
"collection-set-community-2": "2014-02-19",
"collection-set-community-4": "2014-06-23",
"collection-set-esports-iii": "2014-07-10",
"collection-set-community-5": "2014-11-05",
"collection-set-community-6": "2015-01-08",
"collection-set-community-7": "2015-04-15",
"collection-set-dust": "2013-08-14",
"collection-set-aztec": "2013-08-14",
"collection-set-vertigo": "2013-08-14",
"collection-set-inferno": "2013-08-14",
"collection-set-militia": "2013-08-14",
"collection-set-nuke": "2013-08-14",
"collection-set-office": "2013-08-14",
"collection-set-assault": "2013-08-14",
"collection-set-bravo-ii": "2013-09-19",
"collection-set-dust-2": "2013-11-27",
"collection-set-train": "2013-11-27",
"collection-set-mirage": "2013-11-27",
"collection-set-italy": "2013-11-27",
"collection-set-lake": "2013-11-27",
"collection-set-safehouse": "2013-11-27",
"collection-set-bank": "2013-11-27",
"collection-set-overpass": "2014-11-11",
"collection-set-cobblestone": "2014-11-11",
"collection-set-baggage": "2014-11-11",
"collection-set-cache": "2014-08-08",
"collection-set-gods-and-monsters": "2015-05-26",
"collection-set-chopshop": "2015-05-26",
"collection-set-kimono": "2015-05-26",
"collection-set-community-8": "2015-04-15",
"collection-set-community-9": "2015-09-15",
"collection-set-community-10": "2015-11-30",
"collection-set-community-11": "2016-01-19",
"collection-set-nuke-2": "2018-09-01",
"collection-set-inferno-2": "2018-09-01",
"collection-set-xraymachine": "2019-10-02",
"collection-set-community-12": "2016-04-19",
"collection-set-community-13": "2016-06-10",
"collection-set-gamma-2": "2016-08-08",
"collection-set-community-15": "2016-11-02",
"collection-set-community-16": "2017-03-01",
"collection-set-community-17": "2017-04-21",
"collection-set-community-18": "2017-09-06",
"collection-set-blacksite": "2018-12-06",
"collection-set-community-19": "2017-12-20",
"collection-set-community-20": "2018-06-07",
"collection-set-stmarc": "2019-11-18",
"collection-set-canals": "2019-11-18",
"collection-set-norse": "2019-11-18",
"collection-set-op9-characters": "2019-11-18",
"collection-set-op10-characters": "2020-12-03",
"collection-set-op11-characters": "2021-09-21",
"collection-set-community-21": "2018-11-29",
"collection-set-community-22": "2019-03-05",
"collection-set-community-23": "2019-06-12",
"collection-set-community-24": "2019-10-14",
"collection-set-dust-2-2021": "2021-09-21",
"collection-set-mirage-2021": "2021-09-21",
"collection-set-community-25": "2020-03-24",
"collection-set-community-26": "2020-07-13",
"collection-set-community-27": "2020-10-14",
"collection-set-op10-ct": "2020-12-03",
"collection-set-op10-t": "2020-12-03",
"collection-set-op10-ancient": "2020-12-03",
"collection-set-community-28": "2021-03-26",
"collection-set-train-2021": "2021-09-21",
"collection-set-vertigo-2021": "2021-09-21",
"collection-set-anubis": "2023-04-24",
"collection-set-community-29": "2021-09-08",
"collection-set-community-30": "2021-11-17",
"collection-set-community-31": "2022-05-30",
"collection-set-community-32": "2023-01-31",
"collection-set-community-33": "2024-01-16",
"collection-set-community-34": "2024-07-01",
"collection-set-community-35": "2025-02-04",
"collection-set-community-36": "2025-09-17",
"collection-set-community-37": "2026-03-12",
"collection-set-graphic-design": "2024-10-02",
"collection-set-overpass-2024": "2024-10-02",
"collection-set-realism-camo": "2024-10-02",
"collection-set-timed-drops-achroma": "2026-01-21",
"collection-set-timed-drops-cool": "2025-03-31",
"collection-set-timed-drops-exuberant": "2026-01-21",
"collection-set-timed-drops-neutral": "2025-03-31",
"collection-set-timed-drops-warm": "2025-03-31",
"collection-set-train-2025": "2025-03-31",
"collection-set-xpshop-wpn-01": null,
"collection-set-community-2025": "2025-10-01",
"collection-set-kc-drboom": "2025-10-01",
"collection-set-kc-missinglink": "2024-10-02",
"collection-set-kc-ml-community-01": "2025-10-01",
"collection-set-kc-weapon-01": "2024-10-02",
"collection-set-stkr-craft-01": "2024-10-02",
"collection-set-stkr-craft-02": "2024-10-02",
"collection-set-sugarface2": "2025-10-01",
"collection-4617": "2017-02-15",
"collection-4618": "2017-02-15",
"collection-4621": "2017-02-15"
}