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.ts29
1 files changed, 9 insertions, 20 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index 4a4dc3820..6a6af3e09 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -30,29 +30,18 @@ async function generateFeed (req: express.Request, res: express.Response, next:
30 let feed = initFeed() 30 let feed = initFeed()
31 const start = 0 31 const start = 0
32 32
33 let resultList: ResultList<VideoModel>
34 const account: AccountModel = res.locals.account 33 const account: AccountModel = res.locals.account
35 const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list' 34 const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
36 35
37 if (account) { 36 const resultList = await VideoModel.listForApi(
38 resultList = await VideoModel.listAccountVideosForApi( 37 start,
39 account.id, 38 FEEDS.COUNT,
40 start, 39 req.query.sort as VideoSortField,
41 FEEDS.COUNT, 40 hideNSFW,
42 req.query.sort as VideoSortField, 41 req.query.filter,
43 hideNSFW, 42 true,
44 true 43 account ? account.id : null
45 ) 44 )
46 } else {
47 resultList = await VideoModel.listForApi(
48 start,
49 FEEDS.COUNT,
50 req.query.sort as VideoSortField,
51 hideNSFW,
52 req.query.filter,
53 true
54 )
55 }
56 45
57 // Adding video items to the feed, one at a time 46 // Adding video items to the feed, one at a time
58 resultList.data.forEach(video => { 47 resultList.data.forEach(video => {