diff options
Diffstat (limited to 'server/controllers/api/overviews.ts')
-rw-r--r-- | server/controllers/api/overviews.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/controllers/api/overviews.ts b/server/controllers/api/overviews.ts index 5b16232e2..68626a508 100644 --- a/server/controllers/api/overviews.ts +++ b/server/controllers/api/overviews.ts | |||
@@ -8,6 +8,7 @@ import { buildNSFWFilter } from '../../helpers/express-utils' | |||
8 | import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants' | 8 | import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants' |
9 | import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' | 9 | import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' |
10 | import { TagModel } from '../../models/video/tag' | 10 | import { TagModel } from '../../models/video/tag' |
11 | import { getServerActor } from '@server/models/application/application' | ||
11 | 12 | ||
12 | const overviewsRouter = express.Router() | 13 | const overviewsRouter = express.Router() |
13 | 14 | ||
@@ -109,11 +110,16 @@ async function getVideos ( | |||
109 | res: express.Response, | 110 | res: express.Response, |
110 | where: { videoChannelId?: number, tagsOneOf?: string[], categoryOneOf?: number[] } | 111 | where: { videoChannelId?: number, tagsOneOf?: string[], categoryOneOf?: number[] } |
111 | ) { | 112 | ) { |
113 | const serverActor = await getServerActor() | ||
114 | |||
112 | const query = await Hooks.wrapObject({ | 115 | const query = await Hooks.wrapObject({ |
113 | start: 0, | 116 | start: 0, |
114 | count: 12, | 117 | count: 12, |
115 | sort: '-createdAt', | 118 | sort: '-createdAt', |
116 | includeLocalVideos: true, | 119 | displayOnlyForFollower: { |
120 | actorId: serverActor.id, | ||
121 | orLocalVideos: true | ||
122 | }, | ||
117 | nsfw: buildNSFWFilter(res), | 123 | nsfw: buildNSFWFilter(res), |
118 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined, | 124 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined, |
119 | withFiles: false, | 125 | withFiles: false, |