diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:07:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:09:03 +0200 |
commit | 89aa3331106874266f6feeee7bff852da2c1727e (patch) | |
tree | 6b03c6c4e4019b3d71da80f88a0775c2b5cbdd65 /server/controllers/api/videos/transcoding.ts | |
parent | ac8f81e3732548a28e0df03d588bf6777fad55cb (diff) | |
download | PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.tar.gz PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.tar.zst PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.zip |
Add ability to force transcoding
Diffstat (limited to 'server/controllers/api/videos/transcoding.ts')
-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( |