-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add transcripts to sanity lesson publish flow #1489
feat: add transcripts to sanity lesson publish flow #1489
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const {deepgram} = await step.run( | ||
'Order Transcript [Deepgram]', | ||
async () => { | ||
return await orderDeepgramTranscript({ | ||
moduleSlug: event.data.body._id, | ||
mediaUrl: event.data.body.videoResource.videoFile.url, | ||
videoResourceId: event.data.body.videoResource._id, | ||
eggheadLessonId: lessonObject.id, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will kick off the transcript-ready
event with necessary data. Added eggheadLessonId
as a optional prop
if (event.data.eggheadLessonId) { | ||
await step.run( | ||
'add transcript and srt to lesson in egghead', | ||
async () => { | ||
let lessonParams = { | ||
'lesson[srt]': event.data.srt ?? '', | ||
'lesson[transcript]': event.data.transcript ?? '', | ||
} | ||
|
||
let body = new URLSearchParams(lessonParams) | ||
|
||
return await eggAxios.put( | ||
`/api/v1/lessons/${event.data.eggheadLessonId}`, | ||
body, | ||
) | ||
}, | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if eggheadLessonId
is present then we want to post srt and transcript to that lesson object
While we are still publishing courses through sanity, this ensures transcripts and SRTs are added when a lesson is created. It will add the transcript to the rails object as well as the video resource in sanity.
The API for transcribing was already in place because of the work we've done with tips, just had to wire this up into the sanity publish flow