diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-20 09:19:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-20 11:05:45 +0200 |
commit | 8054669f1181e815c435e76e81247eff32d41dc5 (patch) | |
tree | 6938a880d7e71a132fa0fc5adf143a21a8b9f938 /server/controllers/feeds.ts | |
parent | 1c58423f6c42f494ea6358043bcb5a735b7bd5d7 (diff) | |
download | PeerTube-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.ts | 18 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as Feed from 'pfeed' | ||
3 | import { buildNSFWFilter } from '../helpers/express-utils' | ||
4 | import { CONFIG } from '../initializers/config' | ||
2 | import { FEEDS, ROUTE_CACHE_LIFETIME, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' | 5 | import { FEEDS, ROUTE_CACHE_LIFETIME, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants' |
3 | import { | 6 | import { |
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' |
13 | import { VideoModel } from '../models/video/video' | ||
14 | import * as Feed from 'pfeed' | ||
15 | import { cacheRoute } from '../middlewares/cache' | 16 | import { cacheRoute } from '../middlewares/cache' |
17 | import { VideoModel } from '../models/video/video' | ||
16 | import { VideoCommentModel } from '../models/video/video-comment' | 18 | import { VideoCommentModel } from '../models/video/video-comment' |
17 | import { buildNSFWFilter } from '../helpers/express-utils' | ||
18 | import { CONFIG } from '../initializers/config' | ||
19 | 19 | ||
20 | const feedsRouter = express.Router() | 20 | const feedsRouter = express.Router() |
21 | 21 | ||
@@ -34,7 +34,7 @@ feedsRouter.get('/feeds/video-comments.:format', | |||
34 | 34 | ||
35 | feedsRouter.get('/feeds/videos.:format', | 35 | feedsRouter.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({ |