diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
commit | 0f6acda11681de90d38dd18669863c6e270851ee (patch) | |
tree | b3b28e00d539645f5a810202dc8afada289e7b2e /server/helpers/custom-validators/videos.ts | |
parent | 9a18a6252071cf21b18f82a24bb63078abb75bc1 (diff) | |
download | PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.gz PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.zst PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.zip |
Does exist
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index d00d24c4c..dd9d62d24 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -165,7 +165,7 @@ function checkUserCanManageVideo (user: UserModel, video: VideoModel, right: Use | |||
165 | return true | 165 | return true |
166 | } | 166 | } |
167 | 167 | ||
168 | async function isVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') { | 168 | async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') { |
169 | const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined | 169 | const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined |
170 | 170 | ||
171 | const video = await fetchVideo(id, fetchType, userId) | 171 | const video = await fetchVideo(id, fetchType, userId) |
@@ -182,7 +182,7 @@ async function isVideoExist (id: number | string, res: Response, fetchType: Vide | |||
182 | return true | 182 | return true |
183 | } | 183 | } |
184 | 184 | ||
185 | async function isVideoChannelOfAccountExist (channelId: number, user: UserModel, res: Response) { | 185 | async function doesVideoChannelOfAccountExist (channelId: number, user: UserModel, res: Response) { |
186 | if (user.hasRight(UserRight.UPDATE_ANY_VIDEO) === true) { | 186 | if (user.hasRight(UserRight.UPDATE_ANY_VIDEO) === true) { |
187 | const videoChannel = await VideoChannelModel.loadAndPopulateAccount(channelId) | 187 | const videoChannel = await VideoChannelModel.loadAndPopulateAccount(channelId) |
188 | if (videoChannel === null) { | 188 | if (videoChannel === null) { |
@@ -236,9 +236,9 @@ export { | |||
236 | isVideoPrivacyValid, | 236 | isVideoPrivacyValid, |
237 | isVideoFileResolutionValid, | 237 | isVideoFileResolutionValid, |
238 | isVideoFileSizeValid, | 238 | isVideoFileSizeValid, |
239 | isVideoExist, | 239 | doesVideoExist, |
240 | isVideoImage, | 240 | isVideoImage, |
241 | isVideoChannelOfAccountExist, | 241 | doesVideoChannelOfAccountExist, |
242 | isVideoSupportValid, | 242 | isVideoSupportValid, |
243 | isVideoFilterValid | 243 | isVideoFilterValid |
244 | } | 244 | } |