]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/jobs.ts
Downsample to the closest divisor standard framerate
[github/Chocobozzz/PeerTube.git] / server / controllers / api / jobs.ts
index c19596dde2c5518c2048616c38721afab19e1d4b..05320311e98e00e21ebd4e52689496c31bf7db06 100644 (file)
@@ -24,7 +24,7 @@ jobsRouter.get('/:state',
   jobsSortValidator,
   setDefaultSort,
   setDefaultPagination,
-  asyncMiddleware(listJobsValidator),
+  listJobsValidator,
   asyncMiddleware(listJobs)
 )
 
@@ -36,11 +36,18 @@ export {
 
 // ---------------------------------------------------------------------------
 
-async function listJobs (req: express.Request, res: express.Response, next: express.NextFunction) {
-  const state: JobState = req.params.state
+async function listJobs (req: express.Request, res: express.Response) {
+  const state = req.params.state as JobState
   const asc = req.query.sort === 'createdAt'
+  const jobType = req.query.jobType
 
-  const jobs = await JobQueue.Instance.listForApi(state, req.query.start, req.query.count, asc)
+  const jobs = await JobQueue.Instance.listForApi({
+    state,
+    start: req.query.start,
+    count: req.query.count,
+    asc,
+    jobType
+  })
   const total = await JobQueue.Instance.count(state)
 
   const result: ResultList<any> = {