diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-03 10:26:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-06 11:19:16 +0200 |
commit | 7e5f9f001d5de22c54748f935edc0c069028bb0e (patch) | |
tree | d07ac657b1bc49a61b6f57f2d2ba8af66dd105bd /server/controllers | |
parent | 2b86fe727490fc0e42c0d147d98c0df612d5507c (diff) | |
download | PeerTube-7e5f9f001d5de22c54748f935edc0c069028bb0e.tar.gz PeerTube-7e5f9f001d5de22c54748f935edc0c069028bb0e.tar.zst PeerTube-7e5f9f001d5de22c54748f935edc0c069028bb0e.zip |
Add audit logs for video import
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/import.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index ca7a5f9ca..33ac83cb9 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -1,11 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { auditLoggerFactory } from '../../../helpers/audit-logger' | 2 | import { auditLoggerFactory, VideoImportAuditView } from '../../../helpers/audit-logger' |
3 | import { | 3 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoImportAddValidator } from '../../../middlewares' |
4 | asyncMiddleware, | ||
5 | asyncRetryTransactionMiddleware, | ||
6 | authenticate, | ||
7 | videoImportAddValidator | ||
8 | } from '../../../middlewares' | ||
9 | import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' | 4 | import { CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript, THUMBNAILS_SIZE } from '../../../initializers' |
10 | import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' | 5 | import { getYoutubeDLInfo, YoutubeDLInfo } from '../../../helpers/youtube-dl' |
11 | import { createReqFiles } from '../../../helpers/express-utils' | 6 | import { createReqFiles } from '../../../helpers/express-utils' |
@@ -136,5 +131,7 @@ async function addVideoImport (req: express.Request, res: express.Response) { | |||
136 | } | 131 | } |
137 | await JobQueue.Instance.createJob({ type: 'video-import', payload }) | 132 | await JobQueue.Instance.createJob({ type: 'video-import', payload }) |
138 | 133 | ||
134 | auditLogger.create(res.locals.oauth.token.User.Account.Actor.getIdentifier(), new VideoImportAuditView(videoImport.toFormattedJSON())) | ||
135 | |||
139 | return res.json(videoImport.toFormattedJSON()) | 136 | return res.json(videoImport.toFormattedJSON()) |
140 | } | 137 | } |