@@ -24,10 +24,10 @@ async function check_store() {
24
24
const title = game . title
25
25
console . log ( game . title )
26
26
console . log ( game . catalogNs . mappings )
27
- const slug = game . catalogNs . mappings != null && game . catalogNs . mappings . length > 0 ? game . catalogNs . mappings [ 0 ] . pageSlug : "error"
27
+ const slug = game . productSlug != null ? game . productSlug : game . catalogNs . mappings != null && game . catalogNs . mappings . length > 0 ? game . catalogNs . mappings [ 0 ] . pageSlug : "error"
28
28
console . log ( slug )
29
29
var original_price = game . price . totalPrice . fmtPrice . originalPrice
30
- original_price = parseFloat ( original_price . replace ( / [ ^ 0 - 9 \. ] + / g, "" ) ) . toFixed ( 2 ) . toString ( )
30
+ original_price = parseFloat ( original_price . replace ( / [ ^ 0 - 9 \. ] + / g, "" ) ) . toFixed ( 2 ) . toString ( )
31
31
const publisher = game . seller . name
32
32
const description = game . description
33
33
var thumbnail = game . keyImages != null ? game . keyImages [ 0 ] . url : "error"
@@ -70,14 +70,14 @@ async function check_store() {
70
70
}
71
71
72
72
// Skip any false-positives (may just be on sale, or non-updated)
73
- if ( game . price . totalPrice . discountPrice != 0 ) {
73
+ if ( game . price . totalPrice . discountPrice != 0 ) {
74
74
skip = true
75
75
}
76
-
77
- if ( ! sendUpcoming && end_date == null ) {
76
+
77
+ if ( ! sendUpcoming && end_date == null ) {
78
78
skip = true
79
79
}
80
-
80
+
81
81
if ( ! skip ) {
82
82
const found_game = {
83
83
title : title ,
@@ -93,7 +93,7 @@ async function check_store() {
93
93
}
94
94
} )
95
95
const ordered_game_list = game_list . sort (
96
- function ( a , b ) {
96
+ function ( a , b ) {
97
97
return ( a . end_date === null ) - ( b . end_date === null ) || + ( a > b ) || - ( a < b ) ;
98
98
} )
99
99
@@ -181,7 +181,7 @@ check_store().then(games => {
181
181
games . forEach ( ( game ) => {
182
182
var webhooks = discord_webhook . split ( "," )
183
183
webhooks . forEach ( ( webhook ) => {
184
- if ( notify ) {
184
+ if ( notify ) {
185
185
send_discord ( game , webhook )
186
186
}
187
187
} )
0 commit comments