Skip to content

Commit 1b72668

Browse files
committed
fix(zoom): trim maxRecordings within page, relax VTT cue-id parsing
1 parent 53032a6 commit 1b72668

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

apps/sim/connectors/zoom/zoom.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ function parseVtt(vtt: string): string {
126126
while (i < lines.length && lines[i].trim() === '') i++
127127
if (i >= lines.length) break
128128

129-
if (/^\d+$/.test(lines[i].trim())) i++
129+
if (i + 1 < lines.length && !lines[i].includes('-->') && lines[i + 1].includes('-->')) {
130+
i++
131+
}
130132

131133
if (i < lines.length && lines[i].includes('-->')) {
132134
i++
@@ -330,15 +332,24 @@ export const zoomConnector: ConnectorConfig = {
330332
const meetings = data.meetings ?? []
331333
const nextPageToken = data.next_page_token?.trim() || undefined
332334

333-
const documents: ExternalDocument[] = []
335+
const allDocuments: ExternalDocument[] = []
334336
for (const meeting of meetings) {
335337
if (!meeting.uuid) continue
336338
const transcript = findTranscriptFile(meeting.recording_files)
337339
if (!transcript) continue
338-
documents.push(recordingToStub(meeting, transcript))
340+
allDocuments.push(recordingToStub(meeting, transcript))
341+
}
342+
343+
const prevFetched = (syncContext?.totalDocsFetched as number) ?? 0
344+
let documents = allDocuments
345+
if (maxRecordings > 0) {
346+
const remaining = Math.max(0, maxRecordings - prevFetched)
347+
if (allDocuments.length > remaining) {
348+
documents = allDocuments.slice(0, remaining)
349+
}
339350
}
340351

341-
const totalFetched = ((syncContext?.totalDocsFetched as number) ?? 0) + documents.length
352+
const totalFetched = prevFetched + documents.length
342353
if (syncContext) syncContext.totalDocsFetched = totalFetched
343354
const hitLimit = maxRecordings > 0 && totalFetched >= maxRecordings
344355
if (hitLimit && syncContext) syncContext.listingCapped = true

0 commit comments

Comments
 (0)