aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 17:30:46 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 17:30:56 +0200
commite0ea4b1d550d20271a74f1b84e7b3babeec9e0b3 (patch)
treee730ee9b71f72bbbceb9bf38c8c53c1902bf51a6 /server/controllers
parent170726f523ff48f89da45473fc53ca54784f43dd (diff)
downloadPeerTube-e0ea4b1d550d20271a74f1b84e7b3babeec9e0b3.tar.gz
PeerTube-e0ea4b1d550d20271a74f1b84e7b3babeec9e0b3.tar.zst
PeerTube-e0ea4b1d550d20271a74f1b84e7b3babeec9e0b3.zip
Implement video channel feeds
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/feeds.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index 7dcaf7004..08f179509 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -3,10 +3,9 @@ import { CONFIG, FEEDS } from '../initializers/constants'
3import { asyncMiddleware, feedsValidator, setDefaultSort, videosSortValidator } from '../middlewares' 3import { asyncMiddleware, feedsValidator, setDefaultSort, videosSortValidator } from '../middlewares'
4import { VideoModel } from '../models/video/video' 4import { VideoModel } from '../models/video/video'
5import * as Feed from 'pfeed' 5import * as Feed from 'pfeed'
6import { ResultList } from '../../shared/models'
7import { AccountModel } from '../models/account/account' 6import { AccountModel } from '../models/account/account'
8import { cacheRoute } from '../middlewares/cache' 7import { cacheRoute } from '../middlewares/cache'
9import { VideoSortField } from '../../client/src/app/shared/video/sort-field.type' 8import { VideoChannelModel } from '../models/video/video-channel'
10 9
11const feedsRouter = express.Router() 10const feedsRouter = express.Router()
12 11
@@ -31,6 +30,7 @@ async function generateFeed (req: express.Request, res: express.Response, next:
31 const start = 0 30 const start = 0
32 31
33 const account: AccountModel = res.locals.account 32 const account: AccountModel = res.locals.account
33 const videoChannel: VideoChannelModel = res.locals.videoChannel
34 const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list' 34 const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
35 35
36 const resultList = await VideoModel.listForApi({ 36 const resultList = await VideoModel.listForApi({
@@ -40,7 +40,8 @@ async function generateFeed (req: express.Request, res: express.Response, next:
40 hideNSFW, 40 hideNSFW,
41 filter: req.query.filter, 41 filter: req.query.filter,
42 withFiles: true, 42 withFiles: true,
43 accountId: account ? account.id : null 43 accountId: account ? account.id : null,
44 videoChannelId: videoChannel ? videoChannel.id : null
44 }) 45 })
45 46
46 // Adding video items to the feed, one at a time 47 // Adding video items to the feed, one at a time