aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/overviews.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 14:37:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit2760b454a761f6af3138b2fb5f34340772ab0d1e (patch)
tree2b3a2d81478f8b432eb54cce4caa5a760c494627 /server/controllers/api/overviews.ts
parente4611b54910d8e7f2b4f8a97ee2d9cc8e1054127 (diff)
downloadPeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.gz
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.zst
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.zip
Deprecate filter video query
Introduce include and isLocal instead
Diffstat (limited to 'server/controllers/api/overviews.ts')
-rw-r--r--server/controllers/api/overviews.ts8
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'
8import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants' 8import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants'
9import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' 9import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares'
10import { TagModel } from '../../models/video/tag' 10import { TagModel } from '../../models/video/tag'
11import { getServerActor } from '@server/models/application/application'
11 12
12const overviewsRouter = express.Router() 13const 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,