From b682a3dc87c1d773dee604e9b0cebb85c22f3ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=C4=8D=C3=A1k?= Date: Thu, 28 Nov 2024 14:45:25 +0100 Subject: [PATCH] Implement PR suggestions --- db/model/Gdoc/GdocBase.ts | 20 +------------------- db/model/Gdoc/rawToEnriched.ts | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/db/model/Gdoc/GdocBase.ts b/db/model/Gdoc/GdocBase.ts index a50cd46372b..03a5f6445cd 100644 --- a/db/model/Gdoc/GdocBase.ts +++ b/db/model/Gdoc/GdocBase.ts @@ -255,25 +255,7 @@ export class GdocBase implements OwidGdocBaseInterface { .map((author) => author.featuredImage) .filter((filename) => !!filename) as string[] - const peopleImages = new Set() - for (const enrichedBlockSource of this.enrichedBlockSources) { - for (const block of enrichedBlockSource) { - traverseEnrichedBlock(block, (block) => { - if (block.type === "people") { - for (const person of block.items) { - if (person.image) peopleImages.add(person.image) - } - } - }) - } - } - - return [ - ...this.filenames, - ...featuredImages, - ...featuredAuthorImages, - ...peopleImages, - ] + return [...this.filenames, ...featuredImages, ...featuredAuthorImages] } get linkedKeyIndicatorSlugs(): string[] { diff --git a/db/model/Gdoc/rawToEnriched.ts b/db/model/Gdoc/rawToEnriched.ts index 1f25a0de67e..e6e3eb0e3b0 100644 --- a/db/model/Gdoc/rawToEnriched.ts +++ b/db/model/Gdoc/rawToEnriched.ts @@ -830,7 +830,7 @@ const parsePeople = (raw: RawBlockPeople): EnrichedBlockPeople => { if (typeof raw.value === "string") return createError({ - message: "Value is a string, not an array of people", + message: "Value is a string, not a list of {.person} blocks", }) return {