-async function generateFeed (req: express.Request, res: express.Response, next: express.NextFunction) {
+async function generateVideoCommentsFeed (req: express.Request, res: express.Response, next: express.NextFunction) {
+ let feed = initFeed()
+ const start = 0
+
+ const videoId: number = res.locals.video ? res.locals.video.id : undefined
+
+ const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId)
+
+ // Adding video items to the feed, one at a time
+ comments.forEach(comment => {
+ feed.addItem({
+ title: `${comment.Video.name} - ${comment.Account.getDisplayName()}`,
+ id: comment.url,
+ link: comment.url,
+ content: comment.text,
+ author: [
+ {
+ name: comment.Account.getDisplayName(),
+ link: comment.Account.Actor.url
+ }
+ ],
+ date: comment.createdAt
+ })
+ })
+
+ // Now the feed generation is done, let's send it!
+ return sendFeed(feed, req, res)
+}
+
+async function generateVideoFeed (req: express.Request, res: express.Response, next: express.NextFunction) {