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/middlewares | |
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/middlewares')
-rw-r--r-- | server/middlewares/sort.ts | 2 |
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' | |||
2 | import { SortType } from '../models/utils' | 2 | import { SortType } from '../models/utils' |
3 | 3 | ||
4 | const setDefaultSort = setDefaultSortFactory('-createdAt') | 4 | const setDefaultSort = setDefaultSortFactory('-createdAt') |
5 | const setDefaultVideosSort = setDefaultSortFactory('-publishedAt') | ||
5 | 6 | ||
6 | const setDefaultVideoRedundanciesSort = setDefaultSortFactory('name') | 7 | const setDefaultVideoRedundanciesSort = setDefaultSortFactory('name') |
7 | 8 | ||
@@ -33,6 +34,7 @@ function setBlacklistSort (req: express.Request, res: express.Response, next: ex | |||
33 | export { | 34 | export { |
34 | setDefaultSort, | 35 | setDefaultSort, |
35 | setDefaultSearchSort, | 36 | setDefaultSearchSort, |
37 | setDefaultVideosSort, | ||
36 | setDefaultVideoRedundanciesSort, | 38 | setDefaultVideoRedundanciesSort, |
37 | setBlacklistSort | 39 | setBlacklistSort |
38 | } | 40 | } |