- let video: VideoModel | null
-
- if (fetchType === 'all') {
- video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
- } else if (fetchType === 'only-video') {
- video = await VideoModel.load(id)
- } else if (fetchType === 'id' || fetchType === 'none') {
- video = await VideoModel.loadOnlyId(id)
- }
+ const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
+
+ const video = await fetchVideo(id, fetchType, userId)