From c058bafcf3a7d8227459f46cb36048627ffc335c Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 14 Feb 2023 10:38:57 +0100 Subject: [PATCH] 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 --- epic-games.js | 11 ----------- prime-gaming.js | 10 ---------- 2 files changed, 21 deletions(-) diff --git a/epic-games.js b/epic-games.js index 710d574..e29ee42 100644 --- a/epic-games.js +++ b/epic-games.js @@ -12,16 +12,6 @@ console.log(datetime(), 'started checking epic-games'); const db = await jsonDb('epic-games.json'); 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 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(); 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] ||= {}; // Detect free games diff --git a/prime-gaming.js b/prime-gaming.js index a6e5630..2001361 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -11,15 +11,6 @@ console.log(datetime(), 'started checking prime-gaming'); const db = await jsonDb('prime-gaming.json'); 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 const context = await firefox.launchPersistentContext(dirs.browser, { @@ -89,7 +80,6 @@ try { // await page.click('button[aria-label="User dropdown and more options"]'); // const twitch = await page.locator('[data-a-target="TwitchDisplayName"]').first().innerText(); // 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] ||= {}; await page.click('button[data-type="Game"]');