Merge pull request #347 from benschool/master

Fixes cache_expiration restore for CS2 Items
This commit is contained in:
DoctorMcKay 2024-10-05 18:41:48 -04:00 committed by GitHub
commit 3347d87f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,9 +68,9 @@ function CEconItem(item, description, contextID) {
// Restore cache_expiration, if we can (for CS:GO items)
if (this.appid == 730 && this.contextid == 2 && this.owner_descriptions) {
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable After ') == 0);
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable/Marketable After ') == 0);
if (description) {
let date = new Date(description.value.substring(15).replace(/[,()]/g, ''));
let date = new Date(description.value.substring(26).replace(/[,()]/g, ''));
if (date) {
this.cache_expiration = date.toISOString();
}