aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r--server/controllers/api/videos/blacklist.ts2
-rw-r--r--server/controllers/api/videos/captions.ts2
-rw-r--r--server/controllers/api/videos/comment.ts8
-rw-r--r--server/controllers/api/videos/index.ts2
-rw-r--r--server/controllers/api/videos/live.ts2
-rw-r--r--server/controllers/api/videos/ownership.ts14
-rw-r--r--server/controllers/api/videos/rate.ts4
-rw-r--r--server/controllers/api/videos/update.ts4
-rw-r--r--server/controllers/api/videos/upload.ts2
-rw-r--r--server/controllers/api/videos/watching.ts2
10 files changed, 21 insertions, 21 deletions
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts
index 530e17965..6bc768471 100644
--- a/server/controllers/api/videos/blacklist.ts
+++ b/server/controllers/api/videos/blacklist.ts
@@ -1,6 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' 2import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist'
3import { UserRight, VideoBlacklistCreate } from '../../../../shared' 3import { UserRight, VideoBlacklistCreate } from '../../../../shared'
4import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
5import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
6import { sequelizeTypescript } from '../../../initializers/database' 7import { sequelizeTypescript } from '../../../initializers/database'
@@ -19,7 +20,6 @@ import {
19 videosBlacklistUpdateValidator 20 videosBlacklistUpdateValidator
20} from '../../../middlewares' 21} from '../../../middlewares'
21import { VideoBlacklistModel } from '../../../models/video/video-blacklist' 22import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
22import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
23 23
24const blacklistRouter = express.Router() 24const blacklistRouter = express.Router()
25 25
diff --git a/server/controllers/api/videos/captions.ts b/server/controllers/api/videos/captions.ts
index ad7423a31..4008de60f 100644
--- a/server/controllers/api/videos/captions.ts
+++ b/server/controllers/api/videos/captions.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { MVideoCaption } from '@server/types/models' 2import { MVideoCaption } from '@server/types/models'
3import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' 4import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
5import { createReqFiles } from '../../../helpers/express-utils' 5import { createReqFiles } from '../../../helpers/express-utils'
6import { logger } from '../../../helpers/logger' 6import { logger } from '../../../helpers/logger'
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index e6f28c1cb..cb696f652 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -1,7 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 2import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models'
3import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models' 3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { VideoCommentCreate } from '../../../../shared/models/videos/comment/video-comment.model' 4import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model'
5import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' 5import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
6import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
7import { sequelizeTypescript } from '../../../initializers/database' 7import { sequelizeTypescript } from '../../../initializers/database'
@@ -136,7 +136,7 @@ async function listVideoThreads (req: express.Request, res: express.Response) {
136 return res.json({ 136 return res.json({
137 ...getFormattedObjects(resultList.data, resultList.total), 137 ...getFormattedObjects(resultList.data, resultList.total),
138 totalNotDeletedComments: resultList.totalNotDeletedComments 138 totalNotDeletedComments: resultList.totalNotDeletedComments
139 }) 139 } as VideoCommentThreads)
140} 140}
141 141
142async function listVideoThreadComments (req: express.Request, res: express.Response) { 142async function listVideoThreadComments (req: express.Request, res: express.Response) {
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 74b100e59..5a2ff81dc 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -6,7 +6,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc'
6import { getServerActor } from '@server/models/application/application' 6import { getServerActor } from '@server/models/application/application'
7import { MVideoAccountLight } from '@server/types/models' 7import { MVideoAccountLight } from '@server/types/models'
8import { VideosCommonQuery } from '../../../../shared' 8import { VideosCommonQuery } from '../../../../shared'
9import { HttpStatusCode } from '../../../../shared/core-utils/miscs' 9import { HttpStatusCode } from '../../../../shared/models'
10import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' 10import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
11import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' 11import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
12import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts
index d8c51c2d4..ed4da8f47 100644
--- a/server/controllers/api/videos/live.ts
+++ b/server/controllers/api/videos/live.ts
@@ -11,7 +11,7 @@ import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator
11import { VideoLiveModel } from '@server/models/video/video-live' 11import { VideoLiveModel } from '@server/models/video/video-live'
12import { MVideoDetails, MVideoFullLight } from '@server/types/models' 12import { MVideoDetails, MVideoFullLight } from '@server/types/models'
13import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' 13import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared'
14import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 14import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
15import { logger } from '../../../helpers/logger' 15import { logger } from '../../../helpers/logger'
16import { sequelizeTypescript } from '../../../initializers/database' 16import { sequelizeTypescript } from '../../../initializers/database'
17import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' 17import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail'
diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts
index 1bb96e046..f48acbc68 100644
--- a/server/controllers/api/videos/ownership.ts
+++ b/server/controllers/api/videos/ownership.ts
@@ -1,6 +1,12 @@
1import * as express from 'express' 1import * as express from 'express'
2import { MVideoFullLight } from '@server/types/models'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
2import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
6import { getFormattedObjects } from '../../../helpers/utils'
3import { sequelizeTypescript } from '../../../initializers/database' 7import { sequelizeTypescript } from '../../../initializers/database'
8import { sendUpdateVideo } from '../../../lib/activitypub/send'
9import { changeVideoChannelShare } from '../../../lib/activitypub/share'
4import { 10import {
5 asyncMiddleware, 11 asyncMiddleware,
6 asyncRetryTransactionMiddleware, 12 asyncRetryTransactionMiddleware,
@@ -11,15 +17,9 @@ import {
11 videosChangeOwnershipValidator, 17 videosChangeOwnershipValidator,
12 videosTerminateChangeOwnershipValidator 18 videosTerminateChangeOwnershipValidator
13} from '../../../middlewares' 19} from '../../../middlewares'
20import { VideoModel } from '../../../models/video/video'
14import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' 21import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership'
15import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
16import { VideoChannelModel } from '../../../models/video/video-channel' 22import { VideoChannelModel } from '../../../models/video/video-channel'
17import { getFormattedObjects } from '../../../helpers/utils'
18import { changeVideoChannelShare } from '../../../lib/activitypub/share'
19import { sendUpdateVideo } from '../../../lib/activitypub/send'
20import { VideoModel } from '../../../models/video/video'
21import { MVideoFullLight } from '@server/types/models'
22import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
23 23
24const ownershipVideoRouter = express.Router() 24const ownershipVideoRouter = express.Router()
25 25
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index 84f42633e..96f6cd886 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -1,13 +1,13 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserVideoRateUpdate } from '../../../../shared' 2import { UserVideoRateUpdate } from '../../../../shared'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { logger } from '../../../helpers/logger' 4import { logger } from '../../../helpers/logger'
4import { VIDEO_RATE_TYPES } from '../../../initializers/constants' 5import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
6import { sequelizeTypescript } from '../../../initializers/database'
5import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' 7import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
6import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' 8import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares'
7import { AccountModel } from '../../../models/account/account' 9import { AccountModel } from '../../../models/account/account'
8import { AccountVideoRateModel } from '../../../models/account/account-video-rate' 10import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
9import { sequelizeTypescript } from '../../../initializers/database'
10import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
11 11
12const rateVideoRouter = express.Router() 12const rateVideoRouter = express.Router()
13 13
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts
index 8affe71c6..49639060b 100644
--- a/server/controllers/api/videos/update.ts
+++ b/server/controllers/api/videos/update.ts
@@ -2,10 +2,11 @@ import * as express from 'express'
2import { Transaction } from 'sequelize/types' 2import { Transaction } from 'sequelize/types'
3import { changeVideoChannelShare } from '@server/lib/activitypub/share' 3import { changeVideoChannelShare } from '@server/lib/activitypub/share'
4import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' 4import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video'
5import { openapiOperationDoc } from '@server/middlewares/doc'
5import { FilteredModelAttributes } from '@server/types' 6import { FilteredModelAttributes } from '@server/types'
6import { MVideoFullLight } from '@server/types/models' 7import { MVideoFullLight } from '@server/types/models'
7import { VideoUpdate } from '../../../../shared' 8import { VideoUpdate } from '../../../../shared'
8import { HttpStatusCode } from '../../../../shared/core-utils/miscs' 9import { HttpStatusCode } from '../../../../shared/models'
9import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' 10import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
10import { resetSequelizeInstance } from '../../../helpers/database-utils' 11import { resetSequelizeInstance } from '../../../helpers/database-utils'
11import { createReqFiles } from '../../../helpers/express-utils' 12import { createReqFiles } from '../../../helpers/express-utils'
@@ -20,7 +21,6 @@ import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist'
20import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares' 21import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares'
21import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' 22import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update'
22import { VideoModel } from '../../../models/video/video' 23import { VideoModel } from '../../../models/video/video'
23import { openapiOperationDoc } from '@server/middlewares/doc'
24 24
25const lTags = loggerTagsFactory('api', 'video') 25const lTags = loggerTagsFactory('api', 'video')
26const auditLogger = auditLoggerFactory('videos') 26const auditLogger = auditLoggerFactory('videos')
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts
index bcd21ac99..1603ef127 100644
--- a/server/controllers/api/videos/upload.ts
+++ b/server/controllers/api/videos/upload.ts
@@ -11,7 +11,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc'
11import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' 11import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
12import { uploadx } from '@uploadx/core' 12import { uploadx } from '@uploadx/core'
13import { VideoCreate, VideoState } from '../../../../shared' 13import { VideoCreate, VideoState } from '../../../../shared'
14import { HttpStatusCode } from '../../../../shared/core-utils/miscs' 14import { HttpStatusCode } from '../../../../shared/models'
15import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' 15import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
16import { retryTransactionWrapper } from '../../../helpers/database-utils' 16import { retryTransactionWrapper } from '../../../helpers/database-utils'
17import { createReqFiles } from '../../../helpers/express-utils' 17import { createReqFiles } from '../../../helpers/express-utils'
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts
index 8b15525aa..05c75e543 100644
--- a/server/controllers/api/videos/watching.ts
+++ b/server/controllers/api/videos/watching.ts
@@ -1,5 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserWatchingVideo } from '../../../../shared' 2import { UserWatchingVideo } from '../../../../shared'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { 4import {
4 asyncMiddleware, 5 asyncMiddleware,
5 asyncRetryTransactionMiddleware, 6 asyncRetryTransactionMiddleware,
@@ -8,7 +9,6 @@ import {
8 videoWatchingValidator 9 videoWatchingValidator
9} from '../../../middlewares' 10} from '../../../middlewares'
10import { UserVideoHistoryModel } from '../../../models/user/user-video-history' 11import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
11import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
12 12
13const watchingRouter = express.Router() 13const watchingRouter = express.Router()
14 14