More robust transcription error job handler

This commit is contained in:
Chocobozzz 2024-07-01 14:38:19 +02:00
parent 85678854c2
commit ebcf3329f5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -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