aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/transcoding.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-28 11:07:03 +0200
committerChocobozzz <me@florianbigard.com>2023-07-28 11:09:03 +0200
commit89aa3331106874266f6feeee7bff852da2c1727e (patch)
tree6b03c6c4e4019b3d71da80f88a0775c2b5cbdd65 /server/controllers/api/videos/transcoding.ts
parentac8f81e3732548a28e0df03d588bf6777fad55cb (diff)
downloadPeerTube-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.ts3
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'
3import { Hooks } from '@server/lib/plugins/hooks' 3import { Hooks } from '@server/lib/plugins/hooks'
4import { createTranscodingJobs } from '@server/lib/transcoding/create-transcoding-job' 4import { createTranscodingJobs } from '@server/lib/transcoding/create-transcoding-job'
5import { computeResolutionsToTranscode } from '@server/lib/transcoding/transcoding-resolutions' 5import { computeResolutionsToTranscode } from '@server/lib/transcoding/transcoding-resolutions'
6import { VideoJobInfoModel } from '@server/models/video/video-job-info'
6import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models' 7import { HttpStatusCode, UserRight, VideoState, VideoTranscodingCreate } from '@shared/models'
7import { asyncMiddleware, authenticate, createTranscodingValidator, ensureUserHasRight } from '../../../middlewares' 8import { 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(