]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/feeds.ts
Translated using Weblate (Polish)
[github/Chocobozzz/PeerTube.git] / server / controllers / feeds.ts
index 104fd5dd97508007746276c6949da5efbf825c1a..fa6c7ac714869a6ecba7795fe791d83025a1c6f9 100644 (file)
@@ -56,17 +56,23 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res
   comments.forEach(comment => {
     const link = WEBSERVER.URL + comment.getCommentStaticPath()
 
+    let title = comment.Video.name
+    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: `${comment.Video.name} - ${comment.Account.getDisplayName()}`,
+      title,
       id: comment.url,
       link,
       content: comment.text,
-      author: [
-        {
-          name: comment.Account.getDisplayName(),
-          link: comment.Account.Actor.url
-        }
-      ],
+      author,
       date: comment.createdAt
     })
   })