Skip to content

Commit d245ee4

Browse files
authored
fix(EpicGames): also filter by the discount price (#112)
1 parent c1f8692 commit d245ee4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/crons/EpicGames.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ interface EpicGamesProducts {
101101
urlSlug: string;
102102
price: {
103103
totalPrice: {
104+
discountPrice?: number;
104105
fmtPrice: {
105106
originalPrice: string;
106107
};
@@ -205,6 +206,9 @@ export async function getOfferedGames(
205206
game.promotions?.promotionalOffers?.[0]?.promotionalOffers?.[0];
206207
if (!promotion) return false;
207208

209+
const price = game.price.totalPrice.discountPrice;
210+
if (price !== 0) return false;
211+
208212
const [startDate, endDate] = [
209213
new Date(promotion.startDate),
210214
new Date(promotion.endDate),

0 commit comments

Comments
 (0)