diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-11 18:06:41 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-11 18:06:41 +0100 |
commit | c3340977343608838203d910bac77d4a59758274 (patch) | |
tree | 2916c705c2797c28984c7e64e2abf2117d32cb91 /server/controllers | |
parent | 566c125d6eee3bd907404523d94e1e0b5e403a46 (diff) | |
download | PeerTube-c3340977343608838203d910bac77d4a59758274.tar.gz PeerTube-c3340977343608838203d910bac77d4a59758274.tar.zst PeerTube-c3340977343608838203d910bac77d4a59758274.zip |
Fix comments feed
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/feeds.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index ba5a476e7..fa6c7ac71 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts | |||
@@ -57,19 +57,22 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res | |||
57 | const link = WEBSERVER.URL + comment.getCommentStaticPath() | 57 | const link = WEBSERVER.URL + comment.getCommentStaticPath() |
58 | 58 | ||
59 | let title = comment.Video.name | 59 | let title = comment.Video.name |
60 | if (comment.Account) title += ` - ${comment.Account.getDisplayName()}` | 60 | const author: { name: string, link: string }[] = [] |
61 | |||
62 | if (comment.Account) { | ||
63 | title += ` - ${comment.Account.getDisplayName()}` | ||
64 | author.push({ | ||
65 | name: comment.Account.getDisplayName(), | ||
66 | link: comment.Account.Actor.url | ||
67 | }) | ||
68 | } | ||
61 | 69 | ||
62 | feed.addItem({ | 70 | feed.addItem({ |
63 | title, | 71 | title, |
64 | id: comment.url, | 72 | id: comment.url, |
65 | link, | 73 | link, |
66 | content: comment.text, | 74 | content: comment.text, |
67 | author: [ | 75 | author, |
68 | { | ||
69 | name: comment.Account.getDisplayName(), | ||
70 | link: comment.Account.Actor.url | ||
71 | } | ||
72 | ], | ||
73 | date: comment.createdAt | 76 | date: comment.createdAt |
74 | }) | 77 | }) |
75 | }) | 78 | }) |