aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r--server/controllers/feeds.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index 3e384c48a..27ebecc40 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -6,6 +6,7 @@ import * as Feed from 'pfeed'
6import { ResultList } from '../../shared/models' 6import { ResultList } from '../../shared/models'
7import { AccountModel } from '../models/account/account' 7import { AccountModel } from '../models/account/account'
8import { cacheRoute } from '../middlewares/cache' 8import { cacheRoute } from '../middlewares/cache'
9import { VideoSortField } from '../../client/src/app/shared/video/sort-field.type'
9 10
10const feedsRouter = express.Router() 11const feedsRouter = express.Router()
11 12
@@ -31,20 +32,22 @@ async function generateFeed (req: express.Request, res: express.Response, next:
31 32
32 let resultList: ResultList<VideoModel> 33 let resultList: ResultList<VideoModel>
33 const account: AccountModel = res.locals.account 34 const account: AccountModel = res.locals.account
35 const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
34 36
35 if (account) { 37 if (account) {
36 resultList = await VideoModel.listAccountVideosForApi( 38 resultList = await VideoModel.listAccountVideosForApi(
37 account.id, 39 account.id,
38 start, 40 start,
39 FEEDS.COUNT, 41 FEEDS.COUNT,
40 req.query.sort, 42 req.query.sort as VideoSortField,
41 true 43 hideNSFW
42 ) 44 )
43 } else { 45 } else {
44 resultList = await VideoModel.listForApi( 46 resultList = await VideoModel.listForApi(
45 start, 47 start,
46 FEEDS.COUNT, 48 FEEDS.COUNT,
47 req.query.sort, 49 req.query.sort as VideoSortField,
50 hideNSFW,
48 req.query.filter, 51 req.query.filter,
49 true 52 true
50 ) 53 )