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:
parent
f8db7406cf
commit
89c0f36a53
6 changed files with 55 additions and 18 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue