Fix comments feed

This commit is contained in:
Chocobozzz 2019-12-11 18:06:41 +01:00
parent 566c125d6e
commit c334097734
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 10 additions and 7 deletions

View File

@ -57,19 +57,22 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res
const link = WEBSERVER.URL + comment.getCommentStaticPath() const link = WEBSERVER.URL + comment.getCommentStaticPath()
let title = comment.Video.name let title = comment.Video.name
if (comment.Account) title += ` - ${comment.Account.getDisplayName()}` const author: { name: string, link: string }[] = []
if (comment.Account) {
title += ` - ${comment.Account.getDisplayName()}`
author.push({
name: comment.Account.getDisplayName(),
link: comment.Account.Actor.url
})
}
feed.addItem({ feed.addItem({
title, title,
id: comment.url, id: comment.url,
link, link,
content: comment.text, content: comment.text,
author: [ author,
{
name: comment.Account.getDisplayName(),
link: comment.Account.Actor.url
}
],
date: comment.createdAt date: comment.createdAt
}) })
}) })