Fix comments feed

pull/2330/head
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()
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({
title,
id: comment.url,
link,
content: comment.text,
author: [
{
name: comment.Account.getDisplayName(),
link: comment.Account.Actor.url
}
],
author,
date: comment.createdAt
})
})