aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
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/middlewares
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/middlewares')
-rw-r--r--server/middlewares/sort.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/middlewares/sort.ts b/server/middlewares/sort.ts
index fcbb2902c..609046a46 100644
--- a/server/middlewares/sort.ts
+++ b/server/middlewares/sort.ts
@@ -2,6 +2,7 @@ import * as express from 'express'
2import { SortType } from '../models/utils' 2import { SortType } from '../models/utils'
3 3
4const setDefaultSort = setDefaultSortFactory('-createdAt') 4const setDefaultSort = setDefaultSortFactory('-createdAt')
5const setDefaultVideosSort = setDefaultSortFactory('-publishedAt')
5 6
6const setDefaultVideoRedundanciesSort = setDefaultSortFactory('name') 7const setDefaultVideoRedundanciesSort = setDefaultSortFactory('name')
7 8
@@ -33,6 +34,7 @@ function setBlacklistSort (req: express.Request, res: express.Response, next: ex
33export { 34export {
34 setDefaultSort, 35 setDefaultSort,
35 setDefaultSearchSort, 36 setDefaultSearchSort,
37 setDefaultVideosSort,
36 setDefaultVideoRedundanciesSort, 38 setDefaultVideoRedundanciesSort,
37 setBlacklistSort 39 setBlacklistSort
38} 40}