diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 10:35:15 +0100 |
commit | dae86118ed5d4026d04acb9d0e36829b9ad8eb4e (patch) | |
tree | a5bf9c4487240bf75a9b328cad459a0587f90dea /server/controllers/feeds.ts | |
parent | e65c0c5b1fab9c3d93f51721b2458cf5cf471f20 (diff) | |
download | PeerTube-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.ts | 12 |
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' |
12 | import { VideoModel } from '../models/video/video' | 12 | import { VideoModel } from '../models/video/video' |
13 | import * as Feed from 'pfeed' | 13 | import * as Feed from 'pfeed' |
14 | import { AccountModel } from '../models/account/account' | ||
15 | import { cacheRoute } from '../middlewares/cache' | 14 | import { cacheRoute } from '../middlewares/cache' |
16 | import { VideoChannelModel } from '../models/video/video-channel' | ||
17 | import { VideoCommentModel } from '../models/video/video-comment' | 15 | import { VideoCommentModel } from '../models/video/video-comment' |
18 | import { buildNSFWFilter } from '../helpers/express-utils' | 16 | import { buildNSFWFilter } from '../helpers/express-utils' |
19 | 17 | ||
@@ -42,10 +40,10 @@ export { | |||
42 | 40 | ||
43 | // --------------------------------------------------------------------------- | 41 | // --------------------------------------------------------------------------- |
44 | 42 | ||
45 | async function generateVideoCommentsFeed (req: express.Request, res: express.Response, next: express.NextFunction) { | 43 | async 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 | ||
80 | async function generateVideoFeed (req: express.Request, res: express.Response, next: express.NextFunction) { | 78 | async 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 |