diff options
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r-- | server/controllers/api/users/my-subscriptions.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts index c52df3154..43c4c37d8 100644 --- a/server/controllers/api/users/my-subscriptions.ts +++ b/server/controllers/api/users/my-subscriptions.ts | |||
@@ -15,7 +15,7 @@ import { | |||
15 | } from '../../../middlewares' | 15 | } from '../../../middlewares' |
16 | import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators' | 16 | import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators' |
17 | import { VideoModel } from '../../../models/video/video' | 17 | import { VideoModel } from '../../../models/video/video' |
18 | import { buildNSFWFilter } from '../../../helpers/express-utils' | 18 | import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' |
19 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' | 19 | import { VideoFilter } from '../../../../shared/models/videos/video-query.type' |
20 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | 20 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
21 | import { JobQueue } from '../../../lib/job-queue' | 21 | import { JobQueue } from '../../../lib/job-queue' |
@@ -149,6 +149,8 @@ async function getUserSubscriptions (req: express.Request, res: express.Response | |||
149 | 149 | ||
150 | async function getUserSubscriptionVideos (req: express.Request, res: express.Response) { | 150 | async function getUserSubscriptionVideos (req: express.Request, res: express.Response) { |
151 | const user = res.locals.oauth.token.User | 151 | const user = res.locals.oauth.token.User |
152 | const countVideos = getCountVideos(req) | ||
153 | |||
152 | const resultList = await VideoModel.listForApi({ | 154 | const resultList = await VideoModel.listForApi({ |
153 | start: req.query.start, | 155 | start: req.query.start, |
154 | count: req.query.count, | 156 | count: req.query.count, |
@@ -163,7 +165,8 @@ async function getUserSubscriptionVideos (req: express.Request, res: express.Res | |||
163 | filter: req.query.filter as VideoFilter, | 165 | filter: req.query.filter as VideoFilter, |
164 | withFiles: false, | 166 | withFiles: false, |
165 | followerActorId: user.Account.Actor.id, | 167 | followerActorId: user.Account.Actor.id, |
166 | user | 168 | user, |
169 | countVideos | ||
167 | }) | 170 | }) |
168 | 171 | ||
169 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 172 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |