aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds/shared/common-feed-utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/feeds/shared/common-feed-utils.ts')
-rw-r--r--server/controllers/feeds/shared/common-feed-utils.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/feeds/shared/common-feed-utils.ts b/server/controllers/feeds/shared/common-feed-utils.ts
index 8f35a8b35..9e2f8adbb 100644
--- a/server/controllers/feeds/shared/common-feed-utils.ts
+++ b/server/controllers/feeds/shared/common-feed-utils.ts
@@ -1,10 +1,10 @@
1import express from 'express' 1import express from 'express'
2import { maxBy } from 'lodash'
3import { Feed } from '@peertube/feed' 2import { Feed } from '@peertube/feed'
4import { CustomTag, CustomXMLNS, Person } from '@peertube/feed/lib/typings' 3import { CustomTag, CustomXMLNS, Person } from '@peertube/feed/lib/typings'
5import { mdToOneLinePlainText } from '@server/helpers/markdown' 4import { mdToOneLinePlainText } from '@server/helpers/markdown'
6import { CONFIG } from '@server/initializers/config' 5import { CONFIG } from '@server/initializers/config'
7import { WEBSERVER } from '@server/initializers/constants' 6import { WEBSERVER } from '@server/initializers/constants'
7import { getBiggestActorImage } from '@server/lib/actor-image'
8import { UserModel } from '@server/models/user/user' 8import { UserModel } from '@server/models/user/user'
9import { MAccountDefault, MChannelBannerAccountDefault, MUser, MVideoFullLight } from '@server/types/models' 9import { MAccountDefault, MChannelBannerAccountDefault, MUser, MVideoFullLight } from '@server/types/models'
10import { pick } from '@shared/core-utils' 10import { pick } from '@shared/core-utils'
@@ -105,12 +105,12 @@ export async function buildFeedMetadata (options: {
105 accountLink = videoChannel.Account.getClientUrl() 105 accountLink = videoChannel.Account.getClientUrl()
106 106
107 if (videoChannel.Actor.hasImage(ActorImageType.AVATAR)) { 107 if (videoChannel.Actor.hasImage(ActorImageType.AVATAR)) {
108 const videoChannelAvatar = maxBy(videoChannel.Actor.Avatars, 'width') 108 const videoChannelAvatar = getBiggestActorImage(videoChannel.Actor.Avatars)
109 imageUrl = WEBSERVER.URL + videoChannelAvatar.getStaticPath() 109 imageUrl = WEBSERVER.URL + videoChannelAvatar.getStaticPath()
110 } 110 }
111 111
112 if (videoChannel.Account.Actor.hasImage(ActorImageType.AVATAR)) { 112 if (videoChannel.Account.Actor.hasImage(ActorImageType.AVATAR)) {
113 const accountAvatar = maxBy(videoChannel.Account.Actor.Avatars, 'width') 113 const accountAvatar = getBiggestActorImage(videoChannel.Account.Actor.Avatars)
114 accountImageUrl = WEBSERVER.URL + accountAvatar.getStaticPath() 114 accountImageUrl = WEBSERVER.URL + accountAvatar.getStaticPath()
115 } 115 }
116 116
@@ -123,7 +123,7 @@ export async function buildFeedMetadata (options: {
123 accountLink = link 123 accountLink = link
124 124
125 if (account.Actor.hasImage(ActorImageType.AVATAR)) { 125 if (account.Actor.hasImage(ActorImageType.AVATAR)) {
126 const accountAvatar = maxBy(account.Actor.Avatars, 'width') 126 const accountAvatar = getBiggestActorImage(account.Actor.Avatars)
127 imageUrl = WEBSERVER.URL + accountAvatar?.getStaticPath() 127 imageUrl = WEBSERVER.URL + accountAvatar?.getStaticPath()
128 accountImageUrl = imageUrl 128 accountImageUrl = imageUrl
129 } 129 }