eg: only notify for status 'claimed' or 'failed'; DRYRUN -> 'skipped'

This commit is contained in:
Ralf Vogler 2023-05-05 09:30:37 +02:00
parent 8fdf930415
commit ce51c269f8

View file

@ -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,7 +225,7 @@ 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)}`);
}
}