import express from 'express'
+import { maxBy } from 'lodash'
import { extname } from 'path'
import { Feed } from '@peertube/feed'
import { CustomTag, CustomXMLNS, LiveItemStatus } from '@peertube/feed/lib/typings'
href: account.getClientUrl()
}
+ const commonAttributes = getCommonVideoFeedAttributes(video)
+ const guid = liveItem
+ ? `${video.uuid}_${video.publishedAt.toISOString()}`
+ : commonAttributes.link
+
+ let personImage: string
+
+ if (account.Actor.hasImage(ActorImageType.AVATAR)) {
+ const avatar = maxBy(account.Actor.Avatars, 'width')
+ personImage = WEBSERVER.URL + avatar.getStaticPath()
+ }
+
return {
- ...getCommonVideoFeedAttributes(video),
+ guid,
+ ...commonAttributes,
trackers: video.getTrackerUrls(),
{
...author,
- img: account.Actor.hasImage(ActorImageType.AVATAR)
- ? WEBSERVER.URL + account.Actor.Avatars[0].getStaticPath()
- : undefined
+ img: personImage
}
],