diff options
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r-- | server/controllers/feeds.ts | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index 435b12193..9fa70a7c8 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts | |||
@@ -16,20 +16,20 @@ import { | |||
16 | videosSortValidator, | 16 | videosSortValidator, |
17 | videoSubscriptionFeedsValidator | 17 | videoSubscriptionFeedsValidator |
18 | } from '../middlewares' | 18 | } from '../middlewares' |
19 | import { cacheRoute } from '../middlewares/cache' | 19 | import { cacheRouteFactory } from '../middlewares/cache/cache' |
20 | import { VideoModel } from '../models/video/video' | 20 | import { VideoModel } from '../models/video/video' |
21 | import { VideoCommentModel } from '../models/video/video-comment' | 21 | import { VideoCommentModel } from '../models/video/video-comment' |
22 | 22 | ||
23 | const feedsRouter = express.Router() | 23 | const feedsRouter = express.Router() |
24 | 24 | ||
25 | const cacheRoute = cacheRouteFactory({ | ||
26 | headerBlacklist: [ 'Content-Type' ] | ||
27 | }) | ||
28 | |||
25 | feedsRouter.get('/feeds/video-comments.:format', | 29 | feedsRouter.get('/feeds/video-comments.:format', |
26 | feedsFormatValidator, | 30 | feedsFormatValidator, |
27 | setFeedFormatContentType, | 31 | setFeedFormatContentType, |
28 | asyncMiddleware(cacheRoute({ | 32 | cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS), |
29 | headerBlacklist: [ | ||
30 | 'Content-Type' | ||
31 | ] | ||
32 | })(ROUTE_CACHE_LIFETIME.FEEDS)), | ||
33 | asyncMiddleware(videoFeedsValidator), | 33 | asyncMiddleware(videoFeedsValidator), |
34 | asyncMiddleware(videoCommentsFeedsValidator), | 34 | asyncMiddleware(videoCommentsFeedsValidator), |
35 | asyncMiddleware(generateVideoCommentsFeed) | 35 | asyncMiddleware(generateVideoCommentsFeed) |
@@ -40,11 +40,7 @@ feedsRouter.get('/feeds/videos.:format', | |||
40 | setDefaultVideosSort, | 40 | setDefaultVideosSort, |
41 | feedsFormatValidator, | 41 | feedsFormatValidator, |
42 | setFeedFormatContentType, | 42 | setFeedFormatContentType, |
43 | asyncMiddleware(cacheRoute({ | 43 | cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS), |
44 | headerBlacklist: [ | ||
45 | 'Content-Type' | ||
46 | ] | ||
47 | })(ROUTE_CACHE_LIFETIME.FEEDS)), | ||
48 | commonVideosFiltersValidator, | 44 | commonVideosFiltersValidator, |
49 | asyncMiddleware(videoFeedsValidator), | 45 | asyncMiddleware(videoFeedsValidator), |
50 | asyncMiddleware(generateVideoFeed) | 46 | asyncMiddleware(generateVideoFeed) |
@@ -55,11 +51,7 @@ feedsRouter.get('/feeds/subscriptions.:format', | |||
55 | setDefaultVideosSort, | 51 | setDefaultVideosSort, |
56 | feedsFormatValidator, | 52 | feedsFormatValidator, |
57 | setFeedFormatContentType, | 53 | setFeedFormatContentType, |
58 | asyncMiddleware(cacheRoute({ | 54 | cacheRoute(ROUTE_CACHE_LIFETIME.FEEDS), |
59 | headerBlacklist: [ | ||
60 | 'Content-Type' | ||
61 | ] | ||
62 | })(ROUTE_CACHE_LIFETIME.FEEDS)), | ||
63 | commonVideosFiltersValidator, | 55 | commonVideosFiltersValidator, |
64 | asyncMiddleware(videoSubscriptionFeedsValidator), | 56 | asyncMiddleware(videoSubscriptionFeedsValidator), |
65 | asyncMiddleware(generateVideoFeedForSubscriptions) | 57 | asyncMiddleware(generateVideoFeedForSubscriptions) |
@@ -294,7 +286,7 @@ function addVideosToFeed (feed, videos: VideoModel[]) { | |||
294 | feed.addItem({ | 286 | feed.addItem({ |
295 | title: video.name, | 287 | title: video.name, |
296 | id: video.url, | 288 | id: video.url, |
297 | link: WEBSERVER.URL + '/w/' + video.uuid, | 289 | link: WEBSERVER.URL + video.getWatchStaticPath(), |
298 | description: video.getTruncatedDescription(), | 290 | description: video.getTruncatedDescription(), |
299 | content: video.description, | 291 | content: video.description, |
300 | author: [ | 292 | author: [ |