]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/feeds.ts
Limit user tokens cache
[github/Chocobozzz/PeerTube.git] / server / controllers / feeds.ts
index 960085af1af685d017c79e71fd324959105453a6..cd46b6e0f62792d9ad367a93e1b80d93279cf863 100644 (file)
@@ -11,9 +11,7 @@ import {
 } from '../middlewares'
 import { VideoModel } from '../models/video/video'
 import * as Feed from 'pfeed'
-import { AccountModel } from '../models/account/account'
 import { cacheRoute } from '../middlewares/cache'
-import { VideoChannelModel } from '../models/video/video-channel'
 import { VideoCommentModel } from '../models/video/video-comment'
 import { buildNSFWFilter } from '../helpers/express-utils'
 
@@ -42,10 +40,10 @@ export {
 
 // ---------------------------------------------------------------------------
 
-async function generateVideoCommentsFeed (req: express.Request, res: express.Response, next: express.NextFunction) {
+async function generateVideoCommentsFeed (req: express.Request, res: express.Response) {
   const start = 0
 
-  const video = res.locals.video as VideoModel
+  const video = res.locals.video
   const videoId: number = video ? video.id : undefined
 
   const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId)
@@ -77,11 +75,11 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res
   return sendFeed(feed, req, res)
 }
 
-async function generateVideoFeed (req: express.Request, res: express.Response, next: express.NextFunction) {
+async function generateVideoFeed (req: express.Request, res: express.Response) {
   const start = 0
 
-  const account: AccountModel = res.locals.account
-  const videoChannel: VideoChannelModel = res.locals.videoChannel
+  const account = res.locals.account
+  const videoChannel = res.locals.videoChannel
   const nsfw = buildNSFWFilter(res, req.query.nsfw)
 
   let name: string