1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Run transcription after file replacement

This commit is contained in:
Chocobozzz 2025-04-17 15:15:07 +02:00
parent f8db7406cf
commit 89c0f36a53
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 55 additions and 18 deletions

View file

@ -101,6 +101,16 @@ export async function updateHLSMasterOnCaptionChange (video: MVideo, hls: MStrea
// ---------------------------------------------------------------------------
export async function regenerateTranscriptionTaskIfNeeded (video: MVideo) {
if (video.language && CONFIG.VIDEO_TRANSCRIPTION.ENABLED) {
const caption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, video.language)
if (caption?.automaticallyGenerated) {
await createTranscriptionTaskIfNeeded(video)
}
}
}
export async function createTranscriptionTaskIfNeeded (video: MVideoUUID & MVideoUrl) {
if (CONFIG.VIDEO_TRANSCRIPTION.ENABLED !== true) return