diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/captions.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/comment.ts | 8 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/live.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/ownership.ts | 14 | ||||
-rw-r--r-- | server/controllers/api/videos/rate.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/update.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/upload.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/watching.ts | 2 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' | 2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' |
3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' | 3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
5 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { sequelizeTypescript } from '../../../initializers/database' |
@@ -19,7 +20,6 @@ import { | |||
19 | videosBlacklistUpdateValidator | 20 | videosBlacklistUpdateValidator |
20 | } from '../../../middlewares' | 21 | } from '../../../middlewares' |
21 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 22 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
22 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
23 | 23 | ||
24 | const blacklistRouter = express.Router() | 24 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { MVideoCaption } from '@server/types/models' | 2 | import { MVideoCaption } from '@server/types/models' |
3 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 4 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
5 | import { createReqFiles } from '../../../helpers/express-utils' | 5 | import { createReqFiles } from '../../../helpers/express-utils' |
6 | import { logger } from '../../../helpers/logger' | 6 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 2 | import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' |
3 | import { ResultList, ThreadsResultList, UserRight } from '../../../../shared/models' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { VideoCommentCreate } from '../../../../shared/models/videos/comment/video-comment.model' | 4 | import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' |
5 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' | 5 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { 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 | ||
142 | async function listVideoThreadComments (req: express.Request, res: express.Response) { | 142 | async 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' | |||
6 | import { getServerActor } from '@server/models/application/application' | 6 | import { getServerActor } from '@server/models/application/application' |
7 | import { MVideoAccountLight } from '@server/types/models' | 7 | import { MVideoAccountLight } from '@server/types/models' |
8 | import { VideosCommonQuery } from '../../../../shared' | 8 | import { VideosCommonQuery } from '../../../../shared' |
9 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs' | 9 | import { HttpStatusCode } from '../../../../shared/models' |
10 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 10 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
11 | import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' | 11 | import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' |
12 | import { logger } from '../../../helpers/logger' | 12 | import { 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 | |||
11 | import { VideoLiveModel } from '@server/models/video/video-live' | 11 | import { VideoLiveModel } from '@server/models/video/video-live' |
12 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' | 12 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' |
13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' | 13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' |
14 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
15 | import { logger } from '../../../helpers/logger' | 15 | import { logger } from '../../../helpers/logger' |
16 | import { sequelizeTypescript } from '../../../initializers/database' | 16 | import { sequelizeTypescript } from '../../../initializers/database' |
17 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' | 17 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { MVideoFullLight } from '@server/types/models' | ||
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' | ||
2 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | ||
3 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { sequelizeTypescript } from '../../../initializers/database' |
8 | import { sendUpdateVideo } from '../../../lib/activitypub/send' | ||
9 | import { changeVideoChannelShare } from '../../../lib/activitypub/share' | ||
4 | import { | 10 | import { |
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' |
20 | import { VideoModel } from '../../../models/video/video' | ||
14 | import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' | 21 | import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' |
15 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' | ||
16 | import { VideoChannelModel } from '../../../models/video/video-channel' | 22 | import { VideoChannelModel } from '../../../models/video/video-channel' |
17 | import { getFormattedObjects } from '../../../helpers/utils' | ||
18 | import { changeVideoChannelShare } from '../../../lib/activitypub/share' | ||
19 | import { sendUpdateVideo } from '../../../lib/activitypub/send' | ||
20 | import { VideoModel } from '../../../models/video/video' | ||
21 | import { MVideoFullLight } from '@server/types/models' | ||
22 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
23 | 23 | ||
24 | const ownershipVideoRouter = express.Router() | 24 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { UserVideoRateUpdate } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' | 5 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | ||
5 | import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' | 7 | import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' |
6 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' | 8 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' |
7 | import { AccountModel } from '../../../models/account/account' | 9 | import { AccountModel } from '../../../models/account/account' |
8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 10 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
9 | import { sequelizeTypescript } from '../../../initializers/database' | ||
10 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
11 | 11 | ||
12 | const rateVideoRouter = express.Router() | 12 | const 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' | |||
2 | import { Transaction } from 'sequelize/types' | 2 | import { Transaction } from 'sequelize/types' |
3 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' | 3 | import { changeVideoChannelShare } from '@server/lib/activitypub/share' |
4 | import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | 4 | import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' |
5 | import { openapiOperationDoc } from '@server/middlewares/doc' | ||
5 | import { FilteredModelAttributes } from '@server/types' | 6 | import { FilteredModelAttributes } from '@server/types' |
6 | import { MVideoFullLight } from '@server/types/models' | 7 | import { MVideoFullLight } from '@server/types/models' |
7 | import { VideoUpdate } from '../../../../shared' | 8 | import { VideoUpdate } from '../../../../shared' |
8 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs' | 9 | import { HttpStatusCode } from '../../../../shared/models' |
9 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 10 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
10 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | 11 | import { resetSequelizeInstance } from '../../../helpers/database-utils' |
11 | import { createReqFiles } from '../../../helpers/express-utils' | 12 | import { createReqFiles } from '../../../helpers/express-utils' |
@@ -20,7 +21,6 @@ import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' | |||
20 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares' | 21 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares' |
21 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | 22 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' |
22 | import { VideoModel } from '../../../models/video/video' | 23 | import { VideoModel } from '../../../models/video/video' |
23 | import { openapiOperationDoc } from '@server/middlewares/doc' | ||
24 | 24 | ||
25 | const lTags = loggerTagsFactory('api', 'video') | 25 | const lTags = loggerTagsFactory('api', 'video') |
26 | const auditLogger = auditLoggerFactory('videos') | 26 | const 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' | |||
11 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 11 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
12 | import { uploadx } from '@uploadx/core' | 12 | import { uploadx } from '@uploadx/core' |
13 | import { VideoCreate, VideoState } from '../../../../shared' | 13 | import { VideoCreate, VideoState } from '../../../../shared' |
14 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs' | 14 | import { HttpStatusCode } from '../../../../shared/models' |
15 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 15 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
16 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 16 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
17 | import { createReqFiles } from '../../../helpers/express-utils' | 17 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { UserWatchingVideo } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { | 4 | import { |
4 | asyncMiddleware, | 5 | asyncMiddleware, |
5 | asyncRetryTransactionMiddleware, | 6 | asyncRetryTransactionMiddleware, |
@@ -8,7 +9,6 @@ import { | |||
8 | videoWatchingValidator | 9 | videoWatchingValidator |
9 | } from '../../../middlewares' | 10 | } from '../../../middlewares' |
10 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' | 11 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' |
11 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
12 | 12 | ||
13 | const watchingRouter = express.Router() | 13 | const watchingRouter = express.Router() |
14 | 14 | ||