aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/feeds.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-20 09:19:21 +0200
committerChocobozzz <me@florianbigard.com>2020-08-20 11:05:45 +0200
commit8054669f1181e815c435e76e81247eff32d41dc5 (patch)
tree6938a880d7e71a132fa0fc5adf143a21a8b9f938 /server/controllers/feeds.ts
parent1c58423f6c42f494ea6358043bcb5a735b7bd5d7 (diff)
downloadPeerTube-8054669f1181e815c435e76e81247eff32d41dc5.tar.gz
PeerTube-8054669f1181e815c435e76e81247eff32d41dc5.tar.zst
PeerTube-8054669f1181e815c435e76e81247eff32d41dc5.zip
Optimize default sort when listing videos
createdAt does not have the appropriate index
Diffstat (limited to 'server/controllers/feeds.ts')
-rw-r--r--server/controllers/feeds.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts
index bfcd3fe36..f14c0d316 100644
--- a/server/controllers/feeds.ts
+++ b/server/controllers/feeds.ts
@@ -1,21 +1,21 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as Feed from 'pfeed'
3import { buildNSFWFilter } from '../helpers/express-utils'
4import { CONFIG } from '../initializers/config'
2import { FEEDS, ROUTE_CACHE_LIFETIME, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' 5import { FEEDS, ROUTE_CACHE_LIFETIME, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants'
3import { 6import {
4 asyncMiddleware, 7 asyncMiddleware,
5 commonVideosFiltersValidator, 8 commonVideosFiltersValidator,
6 setDefaultSort, 9 feedsFormatValidator,
10 setDefaultVideosSort,
11 setFeedFormatContentType,
7 videoCommentsFeedsValidator, 12 videoCommentsFeedsValidator,
8 videoFeedsValidator, 13 videoFeedsValidator,
9 videosSortValidator, 14 videosSortValidator
10 feedsFormatValidator,
11 setFeedFormatContentType
12} from '../middlewares' 15} from '../middlewares'
13import { VideoModel } from '../models/video/video'
14import * as Feed from 'pfeed'
15import { cacheRoute } from '../middlewares/cache' 16import { cacheRoute } from '../middlewares/cache'
17import { VideoModel } from '../models/video/video'
16import { VideoCommentModel } from '../models/video/video-comment' 18import { VideoCommentModel } from '../models/video/video-comment'
17import { buildNSFWFilter } from '../helpers/express-utils'
18import { CONFIG } from '../initializers/config'
19 19
20const feedsRouter = express.Router() 20const feedsRouter = express.Router()
21 21
@@ -34,7 +34,7 @@ feedsRouter.get('/feeds/video-comments.:format',
34 34
35feedsRouter.get('/feeds/videos.:format', 35feedsRouter.get('/feeds/videos.:format',
36 videosSortValidator, 36 videosSortValidator,
37 setDefaultSort, 37 setDefaultVideosSort,
38 feedsFormatValidator, 38 feedsFormatValidator,
39 setFeedFormatContentType, 39 setFeedFormatContentType,
40 asyncMiddleware(cacheRoute({ 40 asyncMiddleware(cacheRoute({