Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

More robust transcription error job handler

Chocobozzzebcf3329f5b8
diff --git a/server/core/lib/video-captions.ts b/server/core/lib/video-captions.ts
index 00ccc2f11e..7037119f03 100644
--- a/server/core/lib/video-captions.ts
+++ b/server/core/lib/video-captions.ts
@@ -123,6 +123,9 @@ export async function generateSubtitle (options: {
} finally {
if (outputPath) await remove(outputPath)
+ VideoJobInfoModel.decrease(options.video.uuid, 'pendingTranscription')
+ .catch(err => logger.error('Cannot decrease pendingTranscription job count', { err, ...lTags(options.video.uuid) }))
+
inputFileMutexReleaser()
}
}
@@ -135,8 +138,6 @@ export async function onTranscriptionEnded (options: {
}) {
const { video, language, vttPath, lTags: customLTags = [] } = options
- await VideoJobInfoModel.decrease(video.uuid, 'pendingTranscription')
-
if (!isVideoCaptionLanguageValid(language)) {
logger.warn(`Invalid transcription language for video ${video.uuid}`, this.lTags(video.uuid))
return