diff options
Diffstat (limited to 'server/controllers/api/accounts.ts')
-rw-r--r-- | server/controllers/api/accounts.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts index c49da3c0a..00148ff55 100644 --- a/server/controllers/api/accounts.ts +++ b/server/controllers/api/accounts.ts | |||
@@ -22,7 +22,7 @@ import { | |||
22 | import { AccountModel } from '../../models/account/account' | 22 | import { AccountModel } from '../../models/account/account' |
23 | import { AccountVideoRateModel } from '../../models/account/account-video-rate' | 23 | import { AccountVideoRateModel } from '../../models/account/account-video-rate' |
24 | import { VideoModel } from '../../models/video/video' | 24 | import { VideoModel } from '../../models/video/video' |
25 | import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 25 | import { buildNSFWFilter, isUserAbleToSearchRemoteURI, getCountVideos } from '../../helpers/express-utils' |
26 | import { VideoChannelModel } from '../../models/video/video-channel' | 26 | import { VideoChannelModel } from '../../models/video/video-channel' |
27 | import { JobQueue } from '../../lib/job-queue' | 27 | import { JobQueue } from '../../lib/job-queue' |
28 | import { logger } from '../../helpers/logger' | 28 | import { logger } from '../../helpers/logger' |
@@ -155,6 +155,7 @@ async function listAccountPlaylists (req: express.Request, res: express.Response | |||
155 | async function listAccountVideos (req: express.Request, res: express.Response) { | 155 | async function listAccountVideos (req: express.Request, res: express.Response) { |
156 | const account = res.locals.account | 156 | const account = res.locals.account |
157 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined | 157 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined |
158 | const countVideos = getCountVideos(req) | ||
158 | 159 | ||
159 | const resultList = await VideoModel.listForApi({ | 160 | const resultList = await VideoModel.listForApi({ |
160 | followerActorId, | 161 | followerActorId, |
@@ -171,7 +172,8 @@ async function listAccountVideos (req: express.Request, res: express.Response) { | |||
171 | nsfw: buildNSFWFilter(res, req.query.nsfw), | 172 | nsfw: buildNSFWFilter(res, req.query.nsfw), |
172 | withFiles: false, | 173 | withFiles: false, |
173 | accountId: account.id, | 174 | accountId: account.id, |
174 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined | 175 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined, |
176 | countVideos | ||
175 | }) | 177 | }) |
176 | 178 | ||
177 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 179 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |