diff options
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r-- | server/controllers/activitypub/client.ts | 15 |
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' |
19 | import { | 19 | import { |
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) |