diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/transcoding.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/controllers/api/videos/transcoding.ts b/server/controllers/api/videos/transcoding.ts index 54f484b2b..c0b93742f 100644 --- a/server/controllers/api/videos/transcoding.ts +++ b/server/controllers/api/videos/transcoding.ts | |||
@@ -3,6 +3,7 @@ import { logger, loggerTagsFactory } from '@server/helpers/logger' | |||
3 | import { Hooks } from '@server/lib/plugins/hooks' | 3 | import { Hooks } from '@server/lib/plugins/hooks' |
4 | import { createTranscodingJobs } from '@server/lib/transcoding/create-transcoding-job' | 4 | import { createTranscodingJobs } from '@server/lib/transcoding/create-transcoding-job' |
5 | import { computeResolutionsToTranscode } from '@server/lib/transcoding/transcoding-resolutions' | 5 | import { computeResolutionsToTranscode } from '@server/lib/transcoding/transcoding-resolutions' |
6 | import { VideoJobInfoModel } from '@server/models/video/video-job-info' | ||
6 | import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models' | 7 | import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models' |
7 | import { asyncMiddleware, authenticate, createTranscodingValidator, ensureUserHasRight } from '../../../middlewares' | 8 | import { asyncMiddleware, authenticate, createTranscodingValidator, ensureUserHasRight } from '../../../middlewares' |
8 | 9 | ||
@@ -30,6 +31,8 @@ async function createTranscoding (req: express.Request, res: express.Response) { | |||
30 | 31 | ||
31 | const body: VideoTranscodingCreate = req.body | 32 | const body: VideoTranscodingCreate = req.body |
32 | 33 | ||
34 | await VideoJobInfoModel.abortAllTasks(video.uuid, 'pendingTranscode') | ||
35 | |||
33 | const { resolution: maxResolution, hasAudio } = await video.probeMaxQualityFile() | 36 | const { resolution: maxResolution, hasAudio } = await video.probeMaxQualityFile() |
34 | 37 | ||
35 | const resolutions = await Hooks.wrapObject( | 38 | const resolutions = await Hooks.wrapObject( |