aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/channel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/channel.ts')
-rw-r--r--server/controllers/api/videos/channel.ts37
1 files changed, 13 insertions, 24 deletions
diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts
index 4d1f03903..656bc3129 100644
--- a/server/controllers/api/videos/channel.ts
+++ b/server/controllers/api/videos/channel.ts
@@ -1,31 +1,23 @@
1import * as express from 'express' 1import * as express from 'express'
2 2import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared'
3import { getFormattedObjects, logger, resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers'
3import { database as db } from '../../../initializers' 4import { database as db } from '../../../initializers'
5import { createVideoChannel } from '../../../lib'
4import { 6import {
5 logger, 7 asyncMiddleware,
6 getFormattedObjects,
7 retryTransactionWrapper,
8 resetSequelizeInstance
9} from '../../../helpers'
10import {
11 authenticate, 8 authenticate,
9 listVideoAccountChannelsValidator,
12 paginationValidator, 10 paginationValidator,
13 videoChannelsSortValidator,
14 videoChannelsAddValidator,
15 setVideoChannelsSort,
16 setPagination, 11 setPagination,
17 videoChannelsRemoveValidator, 12 setVideoChannelsSort,
18 videoChannelGetValidator, 13 videoChannelGetValidator,
19 videoChannelsUpdateValidator, 14 videoChannelsAddValidator,
20 listVideoAccountChannelsValidator, 15 videoChannelsRemoveValidator,
21 asyncMiddleware 16 videoChannelsSortValidator,
17 videoChannelsUpdateValidator
22} from '../../../middlewares' 18} from '../../../middlewares'
23import { 19import { AccountInstance, VideoChannelInstance } from '../../../models'
24 createVideoChannel, 20import { sendUpdateVideoChannel } from '../../../lib/activitypub/send-request'
25 updateVideoChannelToFriends
26} from '../../../lib'
27import { VideoChannelInstance, AccountInstance } from '../../../models'
28import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared'
29 21
30const videoChannelRouter = express.Router() 22const videoChannelRouter = express.Router()
31 23
@@ -137,11 +129,8 @@ async function updateVideoChannel (req: express.Request, res: express.Response)
137 if (videoChannelInfoToUpdate.description !== undefined) videoChannelInstance.set('description', videoChannelInfoToUpdate.description) 129 if (videoChannelInfoToUpdate.description !== undefined) videoChannelInstance.set('description', videoChannelInfoToUpdate.description)
138 130
139 await videoChannelInstance.save(sequelizeOptions) 131 await videoChannelInstance.save(sequelizeOptions)
140 const json = videoChannelInstance.toUpdateRemoteJSON()
141
142 // Now we'll update the video channel's meta data to our friends
143 return updateVideoChannelToFriends(json, t)
144 132
133 await sendUpdateVideoChannel(videoChannelInstance, t)
145 }) 134 })
146 135
147 logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.uuid) 136 logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.uuid)