diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-20 14:35:18 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-24 14:04:05 +0200 |
commit | d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9 (patch) | |
tree | 4305044c4a97bdf1275b241c63cb0e85151cfb6a /server/controllers/feeds.ts | |
parent | 57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6 (diff) | |
download | PeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.tar.gz PeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.tar.zst PeerTube-d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9.zip |
Add videos list filters
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r-- | server/controllers/feeds.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index ff6b423d9..682f4abda 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts | |||
@@ -8,6 +8,7 @@ import { AccountModel } from '../models/account/account' | |||
8 | import { cacheRoute } from '../middlewares/cache' | 8 | import { cacheRoute } from '../middlewares/cache' |
9 | import { VideoChannelModel } from '../models/video/video-channel' | 9 | import { VideoChannelModel } from '../models/video/video-channel' |
10 | import { VideoCommentModel } from '../models/video/video-comment' | 10 | import { VideoCommentModel } from '../models/video/video-comment' |
11 | import { buildNSFWFilter } from '../helpers/express-utils' | ||
11 | 12 | ||
12 | const feedsRouter = express.Router() | 13 | const feedsRouter = express.Router() |
13 | 14 | ||
@@ -73,7 +74,7 @@ async function generateVideoFeed (req: express.Request, res: express.Response, n | |||
73 | 74 | ||
74 | const account: AccountModel = res.locals.account | 75 | const account: AccountModel = res.locals.account |
75 | const videoChannel: VideoChannelModel = res.locals.videoChannel | 76 | const videoChannel: VideoChannelModel = res.locals.videoChannel |
76 | const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list' | 77 | const nsfw = buildNSFWFilter(res, req.query.nsfw) |
77 | 78 | ||
78 | let name: string | 79 | let name: string |
79 | let description: string | 80 | let description: string |
@@ -95,7 +96,7 @@ async function generateVideoFeed (req: express.Request, res: express.Response, n | |||
95 | start, | 96 | start, |
96 | count: FEEDS.COUNT, | 97 | count: FEEDS.COUNT, |
97 | sort: req.query.sort, | 98 | sort: req.query.sort, |
98 | hideNSFW, | 99 | nsfw, |
99 | filter: req.query.filter, | 100 | filter: req.query.filter, |
100 | withFiles: true, | 101 | withFiles: true, |
101 | accountId: account ? account.id : null, | 102 | accountId: account ? account.id : null, |