aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/channel.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-10 17:27:49 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit571389d43b8fc8aaf27e77c06f19b320b08dbbc9 (patch)
treee57173bcd0590d939c28952a29258fd02a281e35 /server/controllers/api/videos/channel.ts
parent38fa2065831b5f55be0d7f30f19a62c967397208 (diff)
downloadPeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.tar.gz
PeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.tar.zst
PeerTube-571389d43b8fc8aaf27e77c06f19b320b08dbbc9.zip
Make it compile at least
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)