From ef69ee4c9f168b1ca315a6f27c38b42fddeb88d3 Mon Sep 17 00:00:00 2001 From: ewin Date: Thu, 4 Sep 2025 23:07:48 -0400 Subject: [PATCH] use new fancy logging in edb and gt scripts --- bin/add-edb-ids | 5 +++-- bin/add-gt-ids | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/add-edb-ids b/bin/add-edb-ids index cbb1f07..84ccfa4 100755 --- a/bin/add-edb-ids +++ b/bin/add-edb-ids @@ -47,7 +47,8 @@ const pages = (await Promise.all(Object.entries(categoryTypes).map(async ([categ console.log('Processing', pages.length, 'items\n'); -for (const {title, type} of pages) { +for (const page of pages) { + const {title, type} = page; // this runs serially with an artificial delay between requests to decrease // the chance of sqenix sending ninjas to my house await new Promise(resolve => setTimeout(resolve, 1000)); @@ -73,7 +74,7 @@ for (const {title, type} of pages) { let updatedText; try { updatedText = insertInfoboxEDBID(originalText, edbID); - diff(originalText, updatedText); + diff(originalText, updatedText, page); } catch (error) { console.log('Error inserting parameter:', error); console.group('Bad page content:'); diff --git a/bin/add-gt-ids b/bin/add-gt-ids index 458f3c9..d6817a4 100755 --- a/bin/add-gt-ids +++ b/bin/add-gt-ids @@ -38,7 +38,8 @@ const mw = await getMediawikiClient(); const itemPagesWithoutGTIDs = await mw.listCategoryPages('Category:Missing internal ID', [0], +process.env.LIMIT || 500); console.log('Processing', itemPagesWithoutGTIDs.length, 'item pages from [[Category:Missing internal ID]]\n'); -for (const {title} of itemPagesWithoutGTIDs) { +for (const page of itemPagesWithoutGTIDs) { + const {title} = page; console.log('Page:', title); // look up on XIVAPI let gtID; @@ -65,7 +66,7 @@ for (const {title} of itemPagesWithoutGTIDs) { let updatedText; try { updatedText = insertInfoboxGTBID(originalText, gtID); - diff(originalText, updatedText); + diff(originalText, updatedText, page); } catch (error) { console.log('Error inserting parameter:', error); console.group('Bad page content:');