Skip to content

Commit

Permalink
Remove duration from transcript job
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Feb 24, 2025
1 parent c8302cc commit 1833874
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/backend-common/src/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export const generateOutputSignedUrlAndSendMessage = async (
7,
);

// user whisperX if whisperX enabled and...
// duration is either unknown or greater than 10 minutes or diarization has been requested
const engine =
config.app.useWhisperx &&
(!duration || duration > 600 || diarizationRequested)
Expand All @@ -103,7 +105,6 @@ export const generateOutputSignedUrlAndSendMessage = async (
translate: false,
diarize: diarizationRequested,
engine,
duration,
};
const messageResult = await sendMessage(
client,
Expand Down
4 changes: 1 addition & 3 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ export const TranscriptionJob = z.object({
engine: z.nativeEnum(TranscriptionEngine),
// we can get rid of this when we switch to using a zip
translationOutputBucketUrls: z.optional(OutputBucketUrls),
// this is optional because giant currently doesn't know file duration
duration: z.optional(z.number()),
});

export type TranscriptionJob = z.infer<typeof TranscriptionJob>;
Expand All @@ -83,7 +81,6 @@ const OutputBase = z.object({
const TranscriptionOutputBase = OutputBase.extend({
originalFilename: z.string(),
isTranslation: z.boolean(),
duration: z.optional(z.number()),
});

export const TranscriptionOutputSuccess = TranscriptionOutputBase.extend({
Expand All @@ -92,6 +89,7 @@ export const TranscriptionOutputSuccess = TranscriptionOutputBase.extend({
outputBucketKeys: OutputBucketKeys,
// we can get rid of this when we switch to using a zip
translationOutputBucketKeys: z.optional(OutputBucketKeys),
duration: z.optional(z.number()),
});

export const MediaDownloadFailure = OutputBase.extend({
Expand Down
4 changes: 3 additions & 1 deletion packages/output-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ const handleTranscriptionSuccess = async (
),
);

logger.info('Output handler successfully sent success email notification', {
logger.info('Output handler sent success email notification', {
id: transcriptionOutput.id,
filename: transcriptionOutput.originalFilename,
userEmail: transcriptionOutput.userEmail,
duration: transcriptionOutput.duration || '',
languageCode: transcriptionOutput.languageCode,
});
} catch (error) {
logger.error(
Expand Down
1 change: 0 additions & 1 deletion packages/worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ const publishTranscriptionOutputFailure = async (
userEmail: job.userEmail,
originalFilename: job.originalFilename,
isTranslation: job.translate,
duration: job.duration,
};
try {
await publishTranscriptionOutput(sqsClient, destination, failureMessage);
Expand Down

0 comments on commit 1833874

Please sign in to comment.