diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-24 15:10:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-24 15:13:19 +0200 |
commit | 0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb (patch) | |
tree | 79b5befbc6a04c007e5919805f1514d065b30e11 /server/controllers/feeds.ts | |
parent | b4d1af3dd8cdab2d58927e671d62194ca383cd75 (diff) | |
download | PeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.tar.gz PeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.tar.zst PeerTube-0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb.zip |
Add account view
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r-- | server/controllers/feeds.ts | 29 |
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 => { |