diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-10 11:51:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-10 14:32:00 +0200 |
commit | a3b472a12ec6e57dbe2f650419f8064864686eab (patch) | |
tree | f36559488e34493c029b686772e986902150a647 /server/controllers/api/video-channel.ts | |
parent | 0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff) | |
download | PeerTube-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.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 | ||