aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 13:52:49 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 14:53:42 +0200
commit0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch)
tree1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/helpers/middlewares
parent96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff)
downloadPeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.gz
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.zst
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.zip
Cleanup model types
Diffstat (limited to 'server/helpers/middlewares')
-rw-r--r--server/helpers/middlewares/video-channels.ts4
-rw-r--r--server/helpers/middlewares/videos.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/middlewares/video-channels.ts b/server/helpers/middlewares/video-channels.ts
index 17b7692c5..1595ecd94 100644
--- a/server/helpers/middlewares/video-channels.ts
+++ b/server/helpers/middlewares/video-channels.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { VideoChannelModel } from '../../models/video/video-channel' 2import { VideoChannelModel } from '../../models/video/video-channel'
3import { MChannelActorAccountDefault } from '../../typings/models' 3import { MChannelAccountDefault } from '@server/typings/models'
4 4
5async function doesLocalVideoChannelNameExist (name: string, res: express.Response) { 5async function doesLocalVideoChannelNameExist (name: string, res: express.Response) {
6 const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name) 6 const videoChannel = await VideoChannelModel.loadLocalByNameAndPopulateAccount(name)
@@ -28,7 +28,7 @@ export {
28 doesVideoChannelNameWithHostExist 28 doesVideoChannelNameWithHostExist
29} 29}
30 30
31function processVideoChannelExist (videoChannel: MChannelActorAccountDefault, res: express.Response) { 31function processVideoChannelExist (videoChannel: MChannelAccountDefault, res: express.Response) {
32 if (!videoChannel) { 32 if (!videoChannel) {
33 res.status(404) 33 res.status(404)
34 .json({ error: 'Video channel not found' }) 34 .json({ error: 'Video channel not found' })
diff --git a/server/helpers/middlewares/videos.ts b/server/helpers/middlewares/videos.ts
index 964f0c91a..74f529804 100644
--- a/server/helpers/middlewares/videos.ts
+++ b/server/helpers/middlewares/videos.ts
@@ -2,7 +2,7 @@ import { Response } from 'express'
2import { fetchVideo, VideoFetchType } from '../video' 2import { fetchVideo, VideoFetchType } from '../video'
3import { UserRight } from '../../../shared/models/users' 3import { UserRight } from '../../../shared/models/users'
4import { VideoChannelModel } from '../../models/video/video-channel' 4import { VideoChannelModel } from '../../models/video/video-channel'
5import { MUser, MUserAccountId, MVideoAccountLight, MVideoFullLight, MVideoWithRights } from '@server/typings/models' 5import { MUser, MUserAccountId, MVideoAccountLight, MVideoFullLight, MVideoThumbnail, MVideoWithRights } from '@server/typings/models'
6 6
7async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') { 7async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
8 const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined 8 const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
@@ -27,7 +27,7 @@ async function doesVideoExist (id: number | string, res: Response, fetchType: Vi
27 break 27 break
28 28
29 case 'only-video': 29 case 'only-video':
30 res.locals.onlyVideo = video 30 res.locals.onlyVideo = video as MVideoThumbnail
31 break 31 break
32 32
33 case 'only-video-with-rights': 33 case 'only-video-with-rights':