eg: only notify for status 'claimed' or 'failed'; DRYRUN -> 'skipped'
This commit is contained in:
parent
8fdf930415
commit
ce51c269f8
1 changed files with 3 additions and 2 deletions
|
|
@ -177,6 +177,7 @@ try {
|
|||
if (cfg.debug) await page.pause();
|
||||
if (cfg.dryrun) {
|
||||
console.log(' DRYRUN=1 -> Skip order!');
|
||||
notify_game.status = 'skipped';
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -224,9 +225,9 @@ try {
|
|||
notify(`epic-games failed: ${error.message.split('\n')[0]}`);
|
||||
} finally {
|
||||
await db.write(); // write out json db
|
||||
if (notify_games.filter(g => g.status != 'existed' && g.status != 'requires base game').length) { // don't notify if all were already claimed
|
||||
if (notify_games.filter(g => g.status == 'claimed' || g.status == 'failed').length) { // don't notify if all have status 'existed', 'manual', 'requires base game', 'unavailable-in-region', 'skipped'
|
||||
notify(`epic-games (${user}):<br>${html_game_list(notify_games)}`);
|
||||
}
|
||||
}
|
||||
if (cfg.debug) writeFileSync(path.resolve(cfg.dir.browser, 'cookies.json'), JSON.stringify(await context.cookies()));
|
||||
await context.close();
|
||||
await context.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue