X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Ffeeds.ts;h=960085af1af685d017c79e71fd324959105453a6;hb=f5305c04aae14467d6f957b713c5a902275cbb89;hp=682f4abdaf873d56087f4b8b242b8afa0066e487;hpb=d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index 682f4abda..960085af1 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts @@ -1,7 +1,14 @@ import * as express from 'express' import { CONFIG, FEEDS, ROUTE_CACHE_LIFETIME } from '../initializers/constants' import { THUMBNAILS_SIZE } from '../initializers' -import { asyncMiddleware, setDefaultSort, videoCommentsFeedsValidator, videoFeedsValidator, videosSortValidator } from '../middlewares' +import { + asyncMiddleware, + commonVideosFiltersValidator, + setDefaultSort, + videoCommentsFeedsValidator, + videoFeedsValidator, + videosSortValidator +} from '../middlewares' import { VideoModel } from '../models/video/video' import * as Feed from 'pfeed' import { AccountModel } from '../models/account/account' @@ -22,6 +29,7 @@ feedsRouter.get('/feeds/videos.:format', videosSortValidator, setDefaultSort, asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS)), + commonVideosFiltersValidator, asyncMiddleware(videoFeedsValidator), asyncMiddleware(generateVideoFeed) ) @@ -48,7 +56,7 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res // Adding video items to the feed, one at a time comments.forEach(comment => { - const link = CONFIG.WEBSERVER.URL + '/videos/watch/' + comment.Video.uuid + ';threadId=' + comment.getThreadId() + const link = CONFIG.WEBSERVER.URL + comment.getCommentStaticPath() feed.addItem({ title: `${comment.Video.name} - ${comment.Account.getDisplayName()}`, @@ -96,6 +104,7 @@ async function generateVideoFeed (req: express.Request, res: express.Response, n start, count: FEEDS.COUNT, sort: req.query.sort, + includeLocalVideos: true, nsfw, filter: req.query.filter, withFiles: true,