remove migrateDb
comment: remove this after some time since it will run fine without and people can still use this commit to adjust their data/epic-games.json and data/prime-gaming.json
This commit is contained in:
parent
af34113eaf
commit
c058bafcf3
2 changed files with 0 additions and 21 deletions
|
|
@ -12,16 +12,6 @@ console.log(datetime(), 'started checking epic-games');
|
||||||
|
|
||||||
const db = await jsonDb('epic-games.json');
|
const db = await jsonDb('epic-games.json');
|
||||||
db.data ||= {};
|
db.data ||= {};
|
||||||
const migrateDb = (user) => {
|
|
||||||
if (user in db.data || !('claimed' in db.data)) return;
|
|
||||||
db.data[user] = {};
|
|
||||||
for (const e of db.data.claimed) {
|
|
||||||
const k = e.url.split('/').pop();
|
|
||||||
db.data[user][k] = e;
|
|
||||||
}
|
|
||||||
delete db.data.claimed;
|
|
||||||
delete db.data.runs;
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://www.nopecha.com extension source from https://github.com/NopeCHA/NopeCHA/releases/tag/0.1.16
|
// https://www.nopecha.com extension source from https://github.com/NopeCHA/NopeCHA/releases/tag/0.1.16
|
||||||
const ext = path.resolve('nopecha'); // used in Chromium, currently not needed in Firefox
|
const ext = path.resolve('nopecha'); // used in Chromium, currently not needed in Firefox
|
||||||
|
|
@ -99,7 +89,6 @@ try {
|
||||||
}
|
}
|
||||||
const user = await page.locator('#user span').first().innerHTML();
|
const user = await page.locator('#user span').first().innerHTML();
|
||||||
console.log(`Signed in as ${user}`);
|
console.log(`Signed in as ${user}`);
|
||||||
migrateDb(user); // TODO remove this after some time since it will run fine without and people can still use this commit to adjust their data epic-games.json
|
|
||||||
db.data[user] ||= {};
|
db.data[user] ||= {};
|
||||||
|
|
||||||
// Detect free games
|
// Detect free games
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,6 @@ console.log(datetime(), 'started checking prime-gaming');
|
||||||
|
|
||||||
const db = await jsonDb('prime-gaming.json');
|
const db = await jsonDb('prime-gaming.json');
|
||||||
db.data ||= {};
|
db.data ||= {};
|
||||||
const migrateDb = (user) => {
|
|
||||||
if (user in db.data || !('claimed' in db.data)) return;
|
|
||||||
db.data[user] = {};
|
|
||||||
for (const e of db.data.claimed) {
|
|
||||||
db.data[user][e.title] = e;
|
|
||||||
}
|
|
||||||
delete db.data.claimed;
|
|
||||||
delete db.data.runs;
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://playwright.dev/docs/auth#multi-factor-authentication
|
// https://playwright.dev/docs/auth#multi-factor-authentication
|
||||||
const context = await firefox.launchPersistentContext(dirs.browser, {
|
const context = await firefox.launchPersistentContext(dirs.browser, {
|
||||||
|
|
@ -89,7 +80,6 @@ try {
|
||||||
// await page.click('button[aria-label="User dropdown and more options"]');
|
// await page.click('button[aria-label="User dropdown and more options"]');
|
||||||
// const twitch = await page.locator('[data-a-target="TwitchDisplayName"]').first().innerText();
|
// const twitch = await page.locator('[data-a-target="TwitchDisplayName"]').first().innerText();
|
||||||
// console.log(`Twitch user name is ${twitch}`);
|
// console.log(`Twitch user name is ${twitch}`);
|
||||||
migrateDb(user); // TODO remove this after some time since it will run fine without and people can still use this commit to adjust their data/prime-gaming.json
|
|
||||||
db.data[user] ||= {};
|
db.data[user] ||= {};
|
||||||
|
|
||||||
await page.click('button[data-type="Game"]');
|
await page.click('button[data-type="Game"]');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue