aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-19 10:35:15 +0100
committerChocobozzz <me@florianbigard.com>2019-03-19 10:35:15 +0100
commitdae86118ed5d4026d04acb9d0e36829b9ad8eb4e (patch)
treea5bf9c4487240bf75a9b328cad459a0587f90dea /server/controllers/feeds.ts
parente65c0c5b1fab9c3d93f51721b2458cf5cf471f20 (diff)
downloadPeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.gz
PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.tar.zst
PeerTube-dae86118ed5d4026d04acb9d0e36829b9ad8eb4e.zip
Cleanup express locals typings
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r--server/controllers/feeds.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index 960085af1..cd46b6e0f 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -11,9 +11,7 @@ import {
11} from '../middlewares' 11} from '../middlewares'
12import { VideoModel } from '../models/video/video' 12import { VideoModel } from '../models/video/video'
13import * as Feed from 'pfeed' 13import * as Feed from 'pfeed'
14import { AccountModel } from '../models/account/account'
15import { cacheRoute } from '../middlewares/cache' 14import { cacheRoute } from '../middlewares/cache'
16import { VideoChannelModel } from '../models/video/video-channel'
17import { VideoCommentModel } from '../models/video/video-comment' 15import { VideoCommentModel } from '../models/video/video-comment'
18import { buildNSFWFilter } from '../helpers/express-utils' 16import { buildNSFWFilter } from '../helpers/express-utils'
19 17
@@ -42,10 +40,10 @@ export {
42 40
43// --------------------------------------------------------------------------- 41// ---------------------------------------------------------------------------
44 42
45async function generateVideoCommentsFeed (req: express.Request, res: express.Response, next: express.NextFunction) { 43async function generateVideoCommentsFeed (req: express.Request, res: express.Response) {
46 const start = 0 44 const start = 0
47 45
48 const video = res.locals.video as VideoModel 46 const video = res.locals.video
49 const videoId: number = video ? video.id : undefined 47 const videoId: number = video ? video.id : undefined
50 48
51 const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId) 49 const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId)
@@ -77,11 +75,11 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res
77 return sendFeed(feed, req, res) 75 return sendFeed(feed, req, res)
78} 76}
79 77
80async function generateVideoFeed (req: express.Request, res: express.Response, next: express.NextFunction) { 78async function generateVideoFeed (req: express.Request, res: express.Response) {
81 const start = 0 79 const start = 0
82 80
83 const account: AccountModel = res.locals.account 81 const account = res.locals.account
84 const videoChannel: VideoChannelModel = res.locals.videoChannel 82 const videoChannel = res.locals.videoChannel
85 const nsfw = buildNSFWFilter(res, req.query.nsfw) 83 const nsfw = buildNSFWFilter(res, req.query.nsfw)
86 84
87 let name: string 85 let name: string