diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-14 15:28:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-14 15:28:30 +0200 |
commit | 06215f15e0a9fea2ef95b8b49cb2b5868fb64017 (patch) | |
tree | 6f7ff9f82ea851ea87fd3fc4b61843c7a38aec43 /server/controllers | |
parent | 59c76ffa8f503e962d517c78f033f1beccb1de1a (diff) | |
download | PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.tar.gz PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.tar.zst PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.zip |
Cleanup utils helper
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/config.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/video-channel.ts | 8 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 6f05c33db..e0539c414 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -4,7 +4,7 @@ import { ServerConfig, UserRight } from '../../../shared' | |||
4 | import { About } from '../../../shared/models/server/about.model' | 4 | import { About } from '../../../shared/models/server/about.model' |
5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' |
6 | import { unlinkPromise, writeFilePromise } from '../../helpers/core-utils' | 6 | import { unlinkPromise, writeFilePromise } from '../../helpers/core-utils' |
7 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/utils' | 7 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' |
8 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' | 8 | import { CONFIG, CONSTRAINTS_FIELDS, reloadConfig } from '../../initializers' |
9 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 9 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
10 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' | 10 | import { customConfigUpdateValidator } from '../../middlewares/validators/config' |
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 3a444547b..023ebbedf 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -1,9 +1,10 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { getFormattedObjects, resetSequelizeInstance } from '../../helpers/utils' | 2 | import { getFormattedObjects } from '../../helpers/utils' |
3 | import { | 3 | import { |
4 | asyncMiddleware, | 4 | asyncMiddleware, |
5 | asyncRetryTransactionMiddleware, | 5 | asyncRetryTransactionMiddleware, |
6 | authenticate, commonVideosFiltersValidator, | 6 | authenticate, |
7 | commonVideosFiltersValidator, | ||
7 | optionalAuthenticate, | 8 | optionalAuthenticate, |
8 | paginationValidator, | 9 | paginationValidator, |
9 | setDefaultPagination, | 10 | setDefaultPagination, |
@@ -19,7 +20,7 @@ import { videosSortValidator } from '../../middlewares/validators' | |||
19 | import { sendUpdateActor } from '../../lib/activitypub/send' | 20 | import { sendUpdateActor } from '../../lib/activitypub/send' |
20 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 21 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' |
21 | import { createVideoChannel } from '../../lib/video-channel' | 22 | import { createVideoChannel } from '../../lib/video-channel' |
22 | import { createReqFiles, buildNSFWFilter } from '../../helpers/express-utils' | 23 | import { buildNSFWFilter, createReqFiles } from '../../helpers/express-utils' |
23 | import { setAsyncActorKeys } from '../../lib/activitypub' | 24 | import { setAsyncActorKeys } from '../../lib/activitypub' |
24 | import { AccountModel } from '../../models/account/account' | 25 | import { AccountModel } from '../../models/account/account' |
25 | import { CONFIG, IMAGE_MIMETYPE_EXT, sequelizeTypescript } from '../../initializers' | 26 | import { CONFIG, IMAGE_MIMETYPE_EXT, sequelizeTypescript } from '../../initializers' |
@@ -28,6 +29,7 @@ import { VideoModel } from '../../models/video/video' | |||
28 | import { updateAvatarValidator } from '../../middlewares/validators/avatar' | 29 | import { updateAvatarValidator } from '../../middlewares/validators/avatar' |
29 | import { updateActorAvatarFile } from '../../lib/avatar' | 30 | import { updateActorAvatarFile } from '../../lib/avatar' |
30 | import { auditLoggerFactory, VideoChannelAuditView } from '../../helpers/audit-logger' | 31 | import { auditLoggerFactory, VideoChannelAuditView } from '../../helpers/audit-logger' |
32 | import { resetSequelizeInstance } from '../../helpers/database-utils' | ||
31 | 33 | ||
32 | const auditLogger = auditLoggerFactory('channels') | 34 | const auditLogger = auditLoggerFactory('channels') |
33 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR }) | 35 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR }) |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c9365da08..92c6ee697 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -6,7 +6,7 @@ import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffmpeg | |||
6 | import { processImage } from '../../../helpers/image-utils' | 6 | import { processImage } from '../../../helpers/image-utils' |
7 | import { logger } from '../../../helpers/logger' | 7 | import { logger } from '../../../helpers/logger' |
8 | import { auditLoggerFactory, VideoAuditView } from '../../../helpers/audit-logger' | 8 | import { auditLoggerFactory, VideoAuditView } from '../../../helpers/audit-logger' |
9 | import { getFormattedObjects, getServerActor, resetSequelizeInstance } from '../../../helpers/utils' | 9 | import { getFormattedObjects, getServerActor } from '../../../helpers/utils' |
10 | import { | 10 | import { |
11 | CONFIG, | 11 | CONFIG, |
12 | IMAGE_MIMETYPE_EXT, | 12 | IMAGE_MIMETYPE_EXT, |
@@ -51,10 +51,11 @@ import { blacklistRouter } from './blacklist' | |||
51 | import { videoCommentRouter } from './comment' | 51 | import { videoCommentRouter } from './comment' |
52 | import { rateVideoRouter } from './rate' | 52 | import { rateVideoRouter } from './rate' |
53 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' | 53 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' |
54 | import { createReqFiles, buildNSFWFilter } from '../../../helpers/express-utils' | 54 | import { buildNSFWFilter, createReqFiles } from '../../../helpers/express-utils' |
55 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | 55 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' |
56 | import { videoCaptionsRouter } from './captions' | 56 | import { videoCaptionsRouter } from './captions' |
57 | import { videoImportsRouter } from './import' | 57 | import { videoImportsRouter } from './import' |
58 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | ||
58 | 59 | ||
59 | const auditLogger = auditLoggerFactory('videos') | 60 | const auditLogger = auditLoggerFactory('videos') |
60 | const videosRouter = express.Router() | 61 | const videosRouter = express.Router() |