X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Ffeeds.ts;h=08f179509e1747bcfb83207e2fa3f0a515747799;hb=e0ea4b1d550d20271a74f1b84e7b3babeec9e0b3;hp=7dcaf7004f311e29bac7d43d701ff5d6e11161ed;hpb=48dce1c90dff4e90a4bcffefaecf157336cf904b;p=github%2FChocobozzz%2FPeerTube.git 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' import { asyncMiddleware, feedsValidator, setDefaultSort, videosSortValidator } from '../middlewares' import { VideoModel } from '../models/video/video' import * as Feed from 'pfeed' -import { ResultList } from '../../shared/models' import { AccountModel } from '../models/account/account' import { cacheRoute } from '../middlewares/cache' -import { VideoSortField } from '../../client/src/app/shared/video/sort-field.type' +import { VideoChannelModel } from '../models/video/video-channel' const feedsRouter = express.Router() @@ -31,6 +30,7 @@ async function generateFeed (req: express.Request, res: express.Response, next: const start = 0 const account: AccountModel = res.locals.account + const videoChannel: VideoChannelModel = res.locals.videoChannel const hideNSFW = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list' const resultList = await VideoModel.listForApi({ @@ -40,7 +40,8 @@ async function generateFeed (req: express.Request, res: express.Response, next: hideNSFW, filter: req.query.filter, withFiles: true, - accountId: account ? account.id : null + accountId: account ? account.id : null, + videoChannelId: videoChannel ? videoChannel.id : null }) // Adding video items to the feed, one at a time