aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-10 11:51:13 +0200
committerChocobozzz <me@florianbigard.com>2022-08-10 14:32:00 +0200
commita3b472a12ec6e57dbe2f650419f8064864686eab (patch)
treef36559488e34493c029b686772e986902150a647 /server/controllers/api/video-channel.ts
parent0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff)
downloadPeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.gz
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.zst
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.zip
Add ability to list imports of a channel sync
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r--server/controllers/api/video-channel.ts9
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'
6import { getServerActor } from '@server/models/application/application' 6import { getServerActor } from '@server/models/application/application'
7import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' 7import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils'
8import { MChannelBannerAccountDefault } from '@server/types/models' 8import { MChannelBannerAccountDefault } from '@server/types/models'
9import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' 9import { ActorImageType, HttpStatusCode, VideoChannelCreate, VideoChannelUpdate, VideosImportInChannelCreate } from '@shared/models'
10import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' 10import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger'
11import { resetSequelizeInstance } from '../../helpers/database-utils' 11import { resetSequelizeInstance } from '../../helpers/database-utils'
12import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' 12import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
@@ -166,7 +166,7 @@ videoChannelRouter.get('/:nameWithHost/followers',
166videoChannelRouter.post('/:nameWithHost/import-videos', 166videoChannelRouter.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
420async function importVideosInChannel (req: express.Request, res: express.Response) { 420async 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