+
+function buildFeedMetadata (options: {
+ videoChannel?: MChannelBannerAccountDefault
+ account?: MAccountDefault
+ video?: MVideoFullLight
+}) {
+ const { video, videoChannel, account } = options
+
+ let imageUrl = WEBSERVER.URL + '/client/assets/images/icons/icon-96x96.png'
+ let name: string
+ let description: string
+
+ if (videoChannel) {
+ name = videoChannel.getDisplayName()
+ description = videoChannel.description
+
+ if (videoChannel.Actor.hasImage(ActorImageType.AVATAR)) {
+ imageUrl = WEBSERVER.URL + videoChannel.Actor.Avatars[0].getStaticPath()
+ }
+ } else if (account) {
+ name = account.getDisplayName()
+ description = account.description
+
+ if (account.Actor.hasImage(ActorImageType.AVATAR)) {
+ imageUrl = WEBSERVER.URL + account.Actor.Avatars[0].getStaticPath()
+ }
+ } else if (video) {
+ name = video.name
+ description = video.description
+ } else {
+ name = CONFIG.INSTANCE.NAME
+ description = CONFIG.INSTANCE.DESCRIPTION
+ }
+
+ return { name, description, imageUrl }
+}