eg: notify: set status existed correctly, fixes #50
This commit is contained in:
parent
01acfc2311
commit
98dff72888
1 changed files with 2 additions and 1 deletions
|
|
@ -136,6 +136,7 @@ try {
|
||||||
|
|
||||||
if (btnText.toLowerCase() == 'in library') {
|
if (btnText.toLowerCase() == 'in library') {
|
||||||
console.log(' Already in library! Nothing to claim.');
|
console.log(' Already in library! Nothing to claim.');
|
||||||
|
notify_game.status = 'existed';
|
||||||
db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed
|
db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed
|
||||||
if (db.data[user][game_id].status == 'failed') db.data[user][game_id].status = 'manual'; // was failed but now it's claimed
|
if (db.data[user][game_id].status == 'failed') db.data[user][game_id].status = 'manual'; // was failed but now it's claimed
|
||||||
} else { // GET
|
} else { // GET
|
||||||
|
|
@ -186,11 +187,11 @@ try {
|
||||||
await page.screenshot({ path: p, fullPage: true });
|
await page.screenshot({ path: p, fullPage: true });
|
||||||
db.data[user][game_id].status = 'failed';
|
db.data[user][game_id].status = 'failed';
|
||||||
}
|
}
|
||||||
|
notify_game.status = db.data[user][game_id].status; // claimed or failed
|
||||||
|
|
||||||
const p = path.resolve(dirs.screenshots, 'epic-games', `${game_id}.png`);
|
const p = path.resolve(dirs.screenshots, 'epic-games', `${game_id}.png`);
|
||||||
if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long...
|
if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long...
|
||||||
}
|
}
|
||||||
notify_game.status = db.data[user][game_id].status;
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error); // .toString()?
|
console.error(error); // .toString()?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue