Skip to content
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

Merged

Conversation

zacjones93
Copy link
Contributor

@zacjones93 zacjones93 commented Oct 15, 2024

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

gif

Copy link

linear bot commented Oct 15, 2024

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
egghead-io-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:27pm

@zacjones93 zacjones93 requested a review from Creeland October 15, 2024 13:43
Comment on lines +168 to +176
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,
})
Copy link
Contributor Author

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

Comment on lines +64 to +81
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,
)
},
)
}
Copy link
Contributor Author

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

@Creeland Creeland merged commit 83faa73 into main Oct 25, 2024
6 checks passed
@Creeland Creeland deleted the zac/egg-351-set-up-transcript-processing-step-on-lesson-publish branch October 25, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants