diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/index.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index e1c775180..c2c5eb640 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -2,16 +2,16 @@ import * as express from 'express' | |||
2 | import { move } from 'fs-extra' | 2 | import { move } from 'fs-extra' |
3 | import { extname } from 'path' | 3 | import { extname } from 'path' |
4 | import toInt from 'validator/lib/toInt' | 4 | import toInt from 'validator/lib/toInt' |
5 | import { addOptimizeOrMergeAudioJob } from '@server/helpers/video' | ||
6 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 5 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' |
7 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' | 6 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' |
8 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' | 7 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
9 | import { LiveManager } from '@server/lib/live-manager' | 8 | import { LiveManager } from '@server/lib/live-manager' |
10 | import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 9 | import { addOptimizeOrMergeAudioJob, buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
11 | import { getVideoFilePath } from '@server/lib/video-paths' | 10 | import { getVideoFilePath } from '@server/lib/video-paths' |
12 | import { getServerActor } from '@server/models/application/application' | 11 | import { getServerActor } from '@server/models/application/application' |
13 | import { MVideoFullLight } from '@server/types/models' | 12 | import { MVideoFullLight } from '@server/types/models' |
14 | import { VideoCreate, VideoState, VideoUpdate } from '../../../../shared' | 13 | import { VideoCreate, VideoState, VideoUpdate } from '../../../../shared' |
14 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
15 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' | 15 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' |
16 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 16 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
17 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | 17 | import { resetSequelizeInstance } from '../../../helpers/database-utils' |
@@ -66,7 +66,6 @@ import { liveRouter } from './live' | |||
66 | import { ownershipVideoRouter } from './ownership' | 66 | import { ownershipVideoRouter } from './ownership' |
67 | import { rateVideoRouter } from './rate' | 67 | import { rateVideoRouter } from './rate' |
68 | import { watchingRouter } from './watching' | 68 | import { watchingRouter } from './watching' |
69 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
70 | 69 | ||
71 | const auditLogger = auditLoggerFactory('videos') | 70 | const auditLogger = auditLoggerFactory('videos') |
72 | const videosRouter = express.Router() | 71 | const videosRouter = express.Router() |
@@ -267,7 +266,7 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
267 | Notifier.Instance.notifyOnNewVideoIfNeeded(videoCreated) | 266 | Notifier.Instance.notifyOnNewVideoIfNeeded(videoCreated) |
268 | 267 | ||
269 | if (video.state === VideoState.TO_TRANSCODE) { | 268 | if (video.state === VideoState.TO_TRANSCODE) { |
270 | await addOptimizeOrMergeAudioJob(videoCreated, videoFile) | 269 | await addOptimizeOrMergeAudioJob(videoCreated, videoFile, res.locals.oauth.token.User) |
271 | } | 270 | } |
272 | 271 | ||
273 | Hooks.runAction('action:api.video.uploaded', { video: videoCreated }) | 272 | Hooks.runAction('action:api.video.uploaded', { video: videoCreated }) |