aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-10 14:48:08 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit38fa2065831b5f55be0d7f30f19a62c967397208 (patch)
tree4a986465e3a88c85bc6a8b5fc992e0f2edd63ef0 /server/controllers
parent0d0e8dd0904b380b70e19ebcb4763d65601c4632 (diff)
downloadPeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.tar.gz
PeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.tar.zst
PeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.zip
Remove references to author
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/activitypub/videos.ts26
-rw-r--r--server/controllers/api/users.ts8
-rw-r--r--server/controllers/api/videos/channel.ts20
-rw-r--r--server/controllers/api/videos/index.ts2
-rw-r--r--server/controllers/client.ts4
-rw-r--r--server/controllers/services.ts2
6 files changed, 31 insertions, 31 deletions
diff --git a/server/controllers/activitypub/videos.ts b/server/controllers/activitypub/videos.ts
index 9a1868ff7..a9b31bf75 100644
--- a/server/controllers/activitypub/videos.ts
+++ b/server/controllers/activitypub/videos.ts
@@ -32,8 +32,8 @@
32// RemoteVideoChannelCreateData, 32// RemoteVideoChannelCreateData,
33// RemoteVideoChannelUpdateData, 33// RemoteVideoChannelUpdateData,
34// RemoteVideoChannelRemoveData, 34// RemoteVideoChannelRemoveData,
35// RemoteVideoAuthorRemoveData, 35// RemoteVideoAccountRemoveData,
36// RemoteVideoAuthorCreateData 36// RemoteVideoAccountCreateData
37// } from '../../../../shared' 37// } from '../../../../shared'
38// import { VideoInstance } from '../../../models/video/video-interface' 38// import { VideoInstance } from '../../../models/video/video-interface'
39// 39//
@@ -49,8 +49,8 @@
49// functionsHash[ENDPOINT_ACTIONS.UPDATE_CHANNEL] = updateRemoteVideoChannelRetryWrapper 49// functionsHash[ENDPOINT_ACTIONS.UPDATE_CHANNEL] = updateRemoteVideoChannelRetryWrapper
50// functionsHash[ENDPOINT_ACTIONS.REMOVE_CHANNEL] = removeRemoteVideoChannelRetryWrapper 50// functionsHash[ENDPOINT_ACTIONS.REMOVE_CHANNEL] = removeRemoteVideoChannelRetryWrapper
51// functionsHash[ENDPOINT_ACTIONS.REPORT_ABUSE] = reportAbuseRemoteVideoRetryWrapper 51// functionsHash[ENDPOINT_ACTIONS.REPORT_ABUSE] = reportAbuseRemoteVideoRetryWrapper
52// functionsHash[ENDPOINT_ACTIONS.ADD_AUTHOR] = addRemoteVideoAuthorRetryWrapper 52// functionsHash[ENDPOINT_ACTIONS.ADD_ACCOUNT] = addRemoteVideoAccountRetryWrapper
53// functionsHash[ENDPOINT_ACTIONS.REMOVE_AUTHOR] = removeRemoteVideoAuthorRetryWrapper 53// functionsHash[ENDPOINT_ACTIONS.REMOVE_ACCOUNT] = removeRemoteVideoAccountRetryWrapper
54// 54//
55// const remoteVideosRouter = express.Router() 55// const remoteVideosRouter = express.Router()
56// 56//
@@ -245,24 +245,24 @@
245// logger.info('Remote video with uuid %s removed.', videoToRemoveData.uuid) 245// logger.info('Remote video with uuid %s removed.', videoToRemoveData.uuid)
246// } 246// }
247// 247//
248// async function removeRemoteVideoAuthorRetryWrapper (authorAttributesToRemove: RemoteVideoAuthorRemoveData, fromPod: PodInstance) { 248// async function removeRemoteVideoAccountRetryWrapper (accountAttributesToRemove: RemoteVideoAccountRemoveData, fromPod: PodInstance) {
249// const options = { 249// const options = {
250// arguments: [ authorAttributesToRemove, fromPod ], 250// arguments: [ accountAttributesToRemove, fromPod ],
251// errorMessage: 'Cannot remove the remote video author with many retries.' 251// errorMessage: 'Cannot remove the remote video account with many retries.'
252// } 252// }
253// 253//
254// await retryTransactionWrapper(removeRemoteVideoAuthor, options) 254// await retryTransactionWrapper(removeRemoteVideoAccount, options)
255// } 255// }
256// 256//
257// async function removeRemoteVideoAuthor (authorAttributesToRemove: RemoteVideoAuthorRemoveData, fromPod: PodInstance) { 257// async function removeRemoteVideoAccount (accountAttributesToRemove: RemoteVideoAccountRemoveData, fromPod: PodInstance) {
258// logger.debug('Removing remote video author "%s".', authorAttributesToRemove.uuid) 258// logger.debug('Removing remote video account "%s".', accountAttributesToRemove.uuid)
259// 259//
260// await db.sequelize.transaction(async t => { 260// await db.sequelize.transaction(async t => {
261// const videoAuthor = await db.Author.loadAuthorByPodAndUUID(authorAttributesToRemove.uuid, fromPod.id, t) 261// const videoAccount = await db.Account.loadAccountByPodAndUUID(accountAttributesToRemove.uuid, fromPod.id, t)
262// await videoAuthor.destroy({ transaction: t }) 262// await videoAccount.destroy({ transaction: t })
263// }) 263// })
264// 264//
265// logger.info('Remote video author with uuid %s removed.', authorAttributesToRemove.uuid) 265// logger.info('Remote video account with uuid %s removed.', accountAttributesToRemove.uuid)
266// } 266// }
267// 267//
268// async function removeRemoteVideoChannelRetryWrapper (videoChannelAttributesToRemove: RemoteVideoChannelRemoveData, fromPod: PodInstance) { 268// async function removeRemoteVideoChannelRetryWrapper (videoChannelAttributesToRemove: RemoteVideoChannelRemoveData, fromPod: PodInstance) {
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index bacfc4552..9ec6feb57 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -28,7 +28,7 @@ import {
28 UserRole, 28 UserRole,
29 UserRight 29 UserRight
30} from '../../../shared' 30} from '../../../shared'
31import { createUserAuthorAndChannel } from '../../lib' 31import { createUserAccountAndChannel } from '../../lib'
32import { UserInstance } from '../../models' 32import { UserInstance } from '../../models'
33import { videosSortValidator } from '../../middlewares/validators/sort' 33import { videosSortValidator } from '../../middlewares/validators/sort'
34import { setVideosSort } from '../../middlewares/sort' 34import { setVideosSort } from '../../middlewares/sort'
@@ -142,9 +142,9 @@ async function createUser (req: express.Request, res: express.Response, next: ex
142 videoQuota: body.videoQuota 142 videoQuota: body.videoQuota
143 }) 143 })
144 144
145 await createUserAuthorAndChannel(user) 145 await createUserAccountAndChannel(user)
146 146
147 logger.info('User %s with its channel and author created.', body.username) 147 logger.info('User %s with its channel and account created.', body.username)
148} 148}
149 149
150async function registerUser (req: express.Request, res: express.Response, next: express.NextFunction) { 150async function registerUser (req: express.Request, res: express.Response, next: express.NextFunction) {
@@ -159,7 +159,7 @@ async function registerUser (req: express.Request, res: express.Response, next:
159 videoQuota: CONFIG.USER.VIDEO_QUOTA 159 videoQuota: CONFIG.USER.VIDEO_QUOTA
160 }) 160 })
161 161
162 await createUserAuthorAndChannel(user) 162 await createUserAccountAndChannel(user)
163 return res.type('json').status(204).end() 163 return res.type('json').status(204).end()
164} 164}
165 165
diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts
index ab54eedee..4d1f03903 100644
--- a/server/controllers/api/videos/channel.ts
+++ b/server/controllers/api/videos/channel.ts
@@ -17,14 +17,14 @@ import {
17 videoChannelsRemoveValidator, 17 videoChannelsRemoveValidator,
18 videoChannelGetValidator, 18 videoChannelGetValidator,
19 videoChannelsUpdateValidator, 19 videoChannelsUpdateValidator,
20 listVideoAuthorChannelsValidator, 20 listVideoAccountChannelsValidator,
21 asyncMiddleware 21 asyncMiddleware
22} from '../../../middlewares' 22} from '../../../middlewares'
23import { 23import {
24 createVideoChannel, 24 createVideoChannel,
25 updateVideoChannelToFriends 25 updateVideoChannelToFriends
26} from '../../../lib' 26} from '../../../lib'
27import { VideoChannelInstance, AuthorInstance } from '../../../models' 27import { VideoChannelInstance, AccountInstance } from '../../../models'
28import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared' 28import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared'
29 29
30const videoChannelRouter = express.Router() 30const videoChannelRouter = express.Router()
@@ -37,9 +37,9 @@ videoChannelRouter.get('/channels',
37 asyncMiddleware(listVideoChannels) 37 asyncMiddleware(listVideoChannels)
38) 38)
39 39
40videoChannelRouter.get('/authors/:authorId/channels', 40videoChannelRouter.get('/accounts/:accountId/channels',
41 listVideoAuthorChannelsValidator, 41 listVideoAccountChannelsValidator,
42 asyncMiddleware(listVideoAuthorChannels) 42 asyncMiddleware(listVideoAccountChannels)
43) 43)
44 44
45videoChannelRouter.post('/channels', 45videoChannelRouter.post('/channels',
@@ -79,8 +79,8 @@ async function listVideoChannels (req: express.Request, res: express.Response, n
79 return res.json(getFormattedObjects(resultList.data, resultList.total)) 79 return res.json(getFormattedObjects(resultList.data, resultList.total))
80} 80}
81 81
82async function listVideoAuthorChannels (req: express.Request, res: express.Response, next: express.NextFunction) { 82async function listVideoAccountChannels (req: express.Request, res: express.Response, next: express.NextFunction) {
83 const resultList = await db.VideoChannel.listByAuthor(res.locals.author.id) 83 const resultList = await db.VideoChannel.listByAccount(res.locals.account.id)
84 84
85 return res.json(getFormattedObjects(resultList.data, resultList.total)) 85 return res.json(getFormattedObjects(resultList.data, resultList.total))
86} 86}
@@ -101,11 +101,11 @@ async function addVideoChannelRetryWrapper (req: express.Request, res: express.R
101 101
102async function addVideoChannel (req: express.Request, res: express.Response) { 102async function addVideoChannel (req: express.Request, res: express.Response) {
103 const videoChannelInfo: VideoChannelCreate = req.body 103 const videoChannelInfo: VideoChannelCreate = req.body
104 const author: AuthorInstance = res.locals.oauth.token.User.Author 104 const account: AccountInstance = res.locals.oauth.token.User.Account
105 let videoChannelCreated: VideoChannelInstance 105 let videoChannelCreated: VideoChannelInstance
106 106
107 await db.sequelize.transaction(async t => { 107 await db.sequelize.transaction(async t => {
108 videoChannelCreated = await createVideoChannel(videoChannelInfo, author, t) 108 videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t)
109 }) 109 })
110 110
111 logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) 111 logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid)
@@ -179,7 +179,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response)
179} 179}
180 180
181async function getVideoChannel (req: express.Request, res: express.Response, next: express.NextFunction) { 181async function getVideoChannel (req: express.Request, res: express.Response, next: express.NextFunction) {
182 const videoChannelWithVideos = await db.VideoChannel.loadAndPopulateAuthorAndVideos(res.locals.videoChannel.id) 182 const videoChannelWithVideos = await db.VideoChannel.loadAndPopulateAccountAndVideos(res.locals.videoChannel.id)
183 183
184 return res.json(videoChannelWithVideos.toFormattedJSON()) 184 return res.json(videoChannelWithVideos.toFormattedJSON())
185} 185}
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 964db151d..9ad84609f 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -395,7 +395,7 @@ async function removeVideo (req: express.Request, res: express.Response) {
395} 395}
396 396
397async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) { 397async function searchVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
398 const resultList = await db.Video.searchAndPopulateAuthorAndPodAndTags( 398 const resultList = await db.Video.searchAndPopulateAccountAndPodAndTags(
399 req.params.value, 399 req.params.value,
400 req.query.field, 400 req.query.field,
401 req.query.start, 401 req.query.start,
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index 67ebfcf1d..40dda7584 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -110,9 +110,9 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons
110 110
111 // Let Angular application handle errors 111 // Let Angular application handle errors
112 if (validator.isUUID(videoId, 4)) { 112 if (validator.isUUID(videoId, 4)) {
113 videoPromise = db.Video.loadByUUIDAndPopulateAuthorAndPodAndTags(videoId) 113 videoPromise = db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(videoId)
114 } else if (validator.isInt(videoId)) { 114 } else if (validator.isInt(videoId)) {
115 videoPromise = db.Video.loadAndPopulateAuthorAndPodAndTags(+videoId) 115 videoPromise = db.Video.loadAndPopulateAccountAndPodAndTags(+videoId)
116 } else { 116 } else {
117 return res.sendFile(indexPath) 117 return res.sendFile(indexPath)
118 } 118 }
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index 99a33a716..0db6e5498 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -47,7 +47,7 @@ function generateOEmbed (req: express.Request, res: express.Response, next: expr
47 width: embedWidth, 47 width: embedWidth,
48 height: embedHeight, 48 height: embedHeight,
49 title: video.name, 49 title: video.name,
50 author_name: video.VideoChannel.Author.name, 50 author_name: video.VideoChannel.Account.name,
51 provider_name: 'PeerTube', 51 provider_name: 'PeerTube',
52 provider_url: webserverUrl 52 provider_url: webserverUrl
53 } 53 }