From 6b4a81ce11f046a619a0fd41f5050be930e92009 Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Mon, 21 Aug 2023 14:20:23 +0330 Subject: [PATCH] fix: restore support for episode transcription/timestamps sections --- package.json | 4 +++- .../unbody/dataTypes/PodcastEpisodeDocument.dataType.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8bb17d2..e80b6f3 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "lint": "next lint", "prepare": "husky install", "codegen": "dotenv -e ./.env -c -- yarn graphql-code-generator --debug --verbose ./codegen.ts", - "codegen:watch": "dotenv -e ./.env -c -- yarn graphql-code-generator --debug --verbose --watch ./codegen.ts" + "codegen:watch": "dotenv -e ./.env -c -- yarn graphql-code-generator --debug --verbose --watch ./codegen.ts", + "codegenx": "dotenv -e ./.env -c -- yarn graphql-code-generator --debug --verbose ./codegen.ts", + "codegenx:watch": "dotenv -e ./.env -c -- yarn graphql-code-generator --debug --verbose ./codegen.ts" }, "lint-staged": { "*.{ts,tsx}": [ diff --git a/src/services/unbody/dataTypes/PodcastEpisodeDocument.dataType.ts b/src/services/unbody/dataTypes/PodcastEpisodeDocument.dataType.ts index 5525747..a076b0b 100644 --- a/src/services/unbody/dataTypes/PodcastEpisodeDocument.dataType.ts +++ b/src/services/unbody/dataTypes/PodcastEpisodeDocument.dataType.ts @@ -61,7 +61,10 @@ export const PodcastEpisodeDataType: UnbodyDataTypeConfig< }) if (context?.parseContent) { - const sections = findSections(['Credits', 'Content'], allBlocks) + const sections = findSections( + ['Credits', 'Content', 'Timestamps', 'Transcription'], + allBlocks, + ) const textBlocks = allBlocks.filter( (block) => block.type === 'text', @@ -79,7 +82,9 @@ export const PodcastEpisodeDataType: UnbodyDataTypeConfig< break } - case 'Content': { + case 'Content': + case 'Timestamps': + case 'Transcription': { content.push(...section.blocks) break