diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 89c7181bd..94285a78d 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -6,7 +6,7 @@ import { ActorFollowModel } from '@server/models/actor/actor-follow' | |||
6 | import { getServerActor } from '@server/models/application/application' | 6 | import { getServerActor } from '@server/models/application/application' |
7 | import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' | 7 | import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' |
8 | import { MChannelBannerAccountDefault } from '@server/types/models' | 8 | import { MChannelBannerAccountDefault } from '@server/types/models' |
9 | import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' | 9 | import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate, VideosImportInChannelCreate } from '@shared/models' |
10 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' | 10 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' |
11 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 11 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
12 | import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 12 | import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' |
@@ -166,7 +166,7 @@ videoChannelRouter.get('/:nameWithHost/followers', | |||
166 | videoChannelRouter.post('/:nameWithHost/import-videos', | 166 | videoChannelRouter.post('/:nameWithHost/import-videos', |
167 | authenticate, | 167 | authenticate, |
168 | asyncMiddleware(videoChannelsNameWithHostValidator), | 168 | asyncMiddleware(videoChannelsNameWithHostValidator), |
169 | videoChannelImportVideosValidator, | 169 | asyncMiddleware(videoChannelImportVideosValidator), |
170 | ensureIsLocalChannel, | 170 | ensureIsLocalChannel, |
171 | ensureCanManageChannel, | 171 | ensureCanManageChannel, |
172 | asyncMiddleware(ensureChannelOwnerCanUpload), | 172 | asyncMiddleware(ensureChannelOwnerCanUpload), |
@@ -418,13 +418,14 @@ async function listVideoChannelFollowers (req: express.Request, res: express.Res | |||
418 | } | 418 | } |
419 | 419 | ||
420 | async function importVideosInChannel (req: express.Request, res: express.Response) { | 420 | async function importVideosInChannel (req: express.Request, res: express.Response) { |
421 | const { externalChannelUrl } = req.body | 421 | const { externalChannelUrl } = req.body as VideosImportInChannelCreate |
422 | 422 | ||
423 | await JobQueue.Instance.createJob({ | 423 | await JobQueue.Instance.createJob({ |
424 | type: 'video-channel-import', | 424 | type: 'video-channel-import', |
425 | payload: { | 425 | payload: { |
426 | externalChannelUrl, | 426 | externalChannelUrl, |
427 | videoChannelId: res.locals.videoChannel.id | 427 | videoChannelId: res.locals.videoChannel.id, |
428 | partOfChannelSyncId: res.locals.videoChannelSync?.id | ||
428 | } | 429 | } |
429 | }) | 430 | }) |
430 | 431 | ||