diff --git a/src/activationHelpers/contextAware/commands.ts b/src/activationHelpers/contextAware/commands.ts index ce23ecd6f..3eef296eb 100644 --- a/src/activationHelpers/contextAware/commands.ts +++ b/src/activationHelpers/contextAware/commands.ts @@ -188,7 +188,7 @@ export async function registerCommands(context: vscode.ExtensionContext) { filesToExport: string[]; options?: { skipValidation?: boolean; removeIds?: boolean; }; }) => { - await exportCodexContent(format, userSelectedPath, filesToExport, options); + return exportCodexContent(format, userSelectedPath, filesToExport, options); } ); diff --git a/src/exportHandler/audioExporter.ts b/src/exportHandler/audioExporter.ts index ef23e101b..247b40b56 100644 --- a/src/exportHandler/audioExporter.ts +++ b/src/exportHandler/audioExporter.ts @@ -5,6 +5,7 @@ import { exec } from "child_process"; import { promisify } from "util"; import * as os from "os"; import * as fs from "fs"; +import { CodexCellTypes } from "../../types/enums"; const execAsync = promisify(exec); @@ -20,6 +21,12 @@ type ExportAudioOptions = { includeTimestamps?: boolean; }; +type AudioCellData = { + startTime?: number; + endTime?: number; + audioStartTime?: number; + audioEndTime?: number; +}; function sanitizeFileComponent(input: string): string { return input @@ -125,7 +132,8 @@ function computeDialogueLineNumbers( const isMerged = !!(data && data.merged); const isDeleted = !!(data && data.deleted); const isParatext = cell?.metadata?.type === "paratext"; - if (!isValidKind || isMerged || isDeleted || isParatext) continue; + const isMilestone = cell?.metadata?.type === CodexCellTypes.MILESTONE; + if (!isValidKind || isMerged || isDeleted || isParatext || isMilestone) continue; const id: string | undefined = cell?.metadata?.id; if (!id) continue; line += 1; @@ -540,6 +548,10 @@ export async function exportAudioAttachments( debug(`Skipping cell with kind ${cell.kind}`); continue; } + if (cell?.metadata?.type === CodexCellTypes.MILESTONE) { + debug(`Skipping milestone cell: ${cell?.metadata?.id}`); + continue; + } if (!isActiveCell(cell)) { debug(`Skipping inactive cell: ${cell?.metadata?.id}`); continue; @@ -588,9 +600,9 @@ export async function exportAudioAttachments( } // Build destination filename: __