aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/my-subscriptions.ts7
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'
16import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators' 16import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators'
17import { VideoModel } from '../../../models/video/video' 17import { VideoModel } from '../../../models/video/video'
18import { buildNSFWFilter } from '../../../helpers/express-utils' 18import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
19import { VideoFilter } from '../../../../shared/models/videos/video-query.type' 19import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
20import { ActorFollowModel } from '../../../models/activitypub/actor-follow' 20import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
21import { JobQueue } from '../../../lib/job-queue' 21import { JobQueue } from '../../../lib/job-queue'
@@ -149,6 +149,8 @@ async function getUserSubscriptions (req: express.Request, res: express.Response
149 149
150async function getUserSubscriptionVideos (req: express.Request, res: express.Response) { 150async 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))