+ const video = res.locals.video as VideoModel
+ const videoId: number = video ? video.id : undefined
+
+ const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId)
+
+ const name = video ? video.name : CONFIG.INSTANCE.NAME
+ const description = video ? video.description : CONFIG.INSTANCE.DESCRIPTION
+ const feed = initFeed(name, description)
+
+ // Adding video items to the feed, one at a time
+ comments.forEach(comment => {
+ const link = CONFIG.WEBSERVER.URL + '/videos/watch/' + comment.Video.uuid + ';threadId=' + comment.getThreadId()
+
+ feed.addItem({
+ title: `${comment.Video.name} - ${comment.Account.getDisplayName()}`,
+ id: comment.url,
+ link,
+ content: comment.text,
+ author: [
+ {
+ name: comment.Account.getDisplayName(),
+ link: comment.Account.Actor.url
+ }
+ ],
+ date: comment.createdAt
+ })
+ })