diff options
Diffstat (limited to 'server/controllers/api/videos/channel.ts')
-rw-r--r-- | server/controllers/api/videos/channel.ts | 37 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | 2 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared' | |
3 | import { getFormattedObjects, logger, resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers' | ||
3 | import { database as db } from '../../../initializers' | 4 | import { database as db } from '../../../initializers' |
5 | import { createVideoChannel } from '../../../lib' | ||
4 | import { | 6 | import { |
5 | logger, | 7 | asyncMiddleware, |
6 | getFormattedObjects, | ||
7 | retryTransactionWrapper, | ||
8 | resetSequelizeInstance | ||
9 | } from '../../../helpers' | ||
10 | import { | ||
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' |
23 | import { | 19 | import { AccountInstance, VideoChannelInstance } from '../../../models' |
24 | createVideoChannel, | 20 | import { sendUpdateVideoChannel } from '../../../lib/activitypub/send-request' |
25 | updateVideoChannelToFriends | ||
26 | } from '../../../lib' | ||
27 | import { VideoChannelInstance, AccountInstance } from '../../../models' | ||
28 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared' | ||
29 | 21 | ||
30 | const videoChannelRouter = express.Router() | 22 | const 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) |