diff options
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r-- | server/controllers/feeds.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index b30ad8e8d..960085af1 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts | |||
@@ -1,7 +1,14 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { CONFIG, FEEDS, ROUTE_CACHE_LIFETIME } from '../initializers/constants' | 2 | import { CONFIG, FEEDS, ROUTE_CACHE_LIFETIME } from '../initializers/constants' |
3 | import { THUMBNAILS_SIZE } from '../initializers' | 3 | import { THUMBNAILS_SIZE } from '../initializers' |
4 | import { asyncMiddleware, setDefaultSort, videoCommentsFeedsValidator, videoFeedsValidator, videosSortValidator } from '../middlewares' | 4 | import { |
5 | asyncMiddleware, | ||
6 | commonVideosFiltersValidator, | ||
7 | setDefaultSort, | ||
8 | videoCommentsFeedsValidator, | ||
9 | videoFeedsValidator, | ||
10 | videosSortValidator | ||
11 | } from '../middlewares' | ||
5 | import { VideoModel } from '../models/video/video' | 12 | import { VideoModel } from '../models/video/video' |
6 | import * as Feed from 'pfeed' | 13 | import * as Feed from 'pfeed' |
7 | import { AccountModel } from '../models/account/account' | 14 | import { AccountModel } from '../models/account/account' |
@@ -22,6 +29,7 @@ feedsRouter.get('/feeds/videos.:format', | |||
22 | videosSortValidator, | 29 | videosSortValidator, |
23 | setDefaultSort, | 30 | setDefaultSort, |
24 | asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS)), | 31 | asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS)), |
32 | commonVideosFiltersValidator, | ||
25 | asyncMiddleware(videoFeedsValidator), | 33 | asyncMiddleware(videoFeedsValidator), |
26 | asyncMiddleware(generateVideoFeed) | 34 | asyncMiddleware(generateVideoFeed) |
27 | ) | 35 | ) |
@@ -48,7 +56,7 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res | |||
48 | 56 | ||
49 | // Adding video items to the feed, one at a time | 57 | // Adding video items to the feed, one at a time |
50 | comments.forEach(comment => { | 58 | comments.forEach(comment => { |
51 | const link = CONFIG.WEBSERVER.URL + '/videos/watch/' + comment.Video.uuid + ';threadId=' + comment.getThreadId() | 59 | const link = CONFIG.WEBSERVER.URL + comment.getCommentStaticPath() |
52 | 60 | ||
53 | feed.addItem({ | 61 | feed.addItem({ |
54 | title: `${comment.Video.name} - ${comment.Account.getDisplayName()}`, | 62 | title: `${comment.Video.name} - ${comment.Account.getDisplayName()}`, |