aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-02-28 08:34:43 +0100
committerGitHub <noreply@github.com>2022-02-28 08:34:43 +0100
commitd0800f7661f13fabe7bb6f4aa0ea50764f106405 (patch)
treed43e6b0b6f4a5a32e03487e6464edbcaf288be2a /server/controllers/activitypub
parent5cad2ca9db9b9d138f8a33058d10b94a9fd50c69 (diff)
downloadPeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.tar.gz
PeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.tar.zst
PeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.zip
Implement avatar miniatures (#4639)
* client: remove unused file * refactor(client/my-actor-avatar): size from input Read size from component input instead of scss, to make it possible to use smaller avatar images when implemented. * implement avatar miniatures close #4560 * fix(test): max file size * fix(search-index): normalize res acc to avatarMini * refactor avatars to an array * client/search: resize channel avatar to 120 * refactor(client/videos): remove unused function * client(actor-avatar): set default size * fix tests and avatars full result When findOne is used only an array containting one avatar is returned. * update migration version and version notations * server/search: harmonize normalizing * Cleanup avatar miniature PR Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r--server/controllers/activitypub/client.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index 4e6bd5e25..c4d1be121 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -18,10 +18,10 @@ import {
18} from '../../lib/activitypub/url' 18} from '../../lib/activitypub/url'
19import { 19import {
20 asyncMiddleware, 20 asyncMiddleware,
21 ensureIsLocalChannel,
21 executeIfActivityPub, 22 executeIfActivityPub,
22 localAccountValidator, 23 localAccountValidator,
23 videoChannelsNameWithHostValidator, 24 videoChannelsNameWithHostValidator,
24 ensureIsLocalChannel,
25 videosCustomGetValidator, 25 videosCustomGetValidator,
26 videosShareValidator 26 videosShareValidator
27} from '../../middlewares' 27} from '../../middlewares'
@@ -265,8 +265,8 @@ async function videoAnnouncesController (req: express.Request, res: express.Resp
265 const handler = async (start: number, count: number) => { 265 const handler = async (start: number, count: number) => {
266 const result = await VideoShareModel.listAndCountByVideoId(video.id, start, count) 266 const result = await VideoShareModel.listAndCountByVideoId(video.id, start, count)
267 return { 267 return {
268 total: result.count, 268 total: result.total,
269 data: result.rows.map(r => r.url) 269 data: result.data.map(r => r.url)
270 } 270 }
271 } 271 }
272 const json = await activityPubCollectionPagination(getLocalVideoSharesActivityPubUrl(video), handler, req.query.page) 272 const json = await activityPubCollectionPagination(getLocalVideoSharesActivityPubUrl(video), handler, req.query.page)
@@ -301,9 +301,10 @@ async function videoCommentsController (req: express.Request, res: express.Respo
301 301
302 const handler = async (start: number, count: number) => { 302 const handler = async (start: number, count: number) => {
303 const result = await VideoCommentModel.listAndCountByVideoForAP(video, start, count) 303 const result = await VideoCommentModel.listAndCountByVideoForAP(video, start, count)
304
304 return { 305 return {
305 total: result.count, 306 total: result.total,
306 data: result.rows.map(r => r.url) 307 data: result.data.map(r => r.url)
307 } 308 }
308 } 309 }
309 const json = await activityPubCollectionPagination(getLocalVideoCommentsActivityPubUrl(video), handler, req.query.page) 310 const json = await activityPubCollectionPagination(getLocalVideoCommentsActivityPubUrl(video), handler, req.query.page)
@@ -425,8 +426,8 @@ function videoRates (req: express.Request, rateType: VideoRateType, video: MVide
425 const handler = async (start: number, count: number) => { 426 const handler = async (start: number, count: number) => {
426 const result = await AccountVideoRateModel.listAndCountAccountUrlsByVideoId(rateType, video.id, start, count) 427 const result = await AccountVideoRateModel.listAndCountAccountUrlsByVideoId(rateType, video.id, start, count)
427 return { 428 return {
428 total: result.count, 429 total: result.total,
429 data: result.rows.map(r => r.url) 430 data: result.data.map(r => r.url)
430 } 431 }
431 } 432 }
432 return activityPubCollectionPagination(url, handler, req.query.page) 433 return activityPubCollectionPagination(url, handler, req.query.page)