]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/sort.ts
Increase captions max size
[github/Chocobozzz/PeerTube.git] / server / middlewares / sort.ts
index fcbb2902cfa7599e7377b4efa85bbd9f77420bdf..4588958988af88a759c35ebfbc7a6afb58ed0643 100644 (file)
@@ -1,7 +1,8 @@
-import * as express from 'express'
+import express from 'express'
 import { SortType } from '../models/utils'
 
 const setDefaultSort = setDefaultSortFactory('-createdAt')
+const setDefaultVideosSort = setDefaultSortFactory('-publishedAt')
 
 const setDefaultVideoRedundanciesSort = setDefaultSortFactory('name')
 
@@ -15,7 +16,7 @@ function setBlacklistSort (req: express.Request, res: express.Response, next: ex
   // Set model we want to sort onto
   if (req.query.sort === '-createdAt' || req.query.sort === 'createdAt' ||
       req.query.sort === '-id' || req.query.sort === 'id') {
-    // If we want to sort onto the BlacklistedVideos relation, we won't specify it in the query parameter ...
+    // If we want to sort onto the BlacklistedVideos relation, we won't specify it in the query parameter...
     newSort.sortModel = undefined
   } else {
     newSort.sortModel = 'Video'
@@ -33,6 +34,7 @@ function setBlacklistSort (req: express.Request, res: express.Response, next: ex
 export {
   setDefaultSort,
   setDefaultSearchSort,
+  setDefaultVideosSort,
   setDefaultVideoRedundanciesSort,
   setBlacklistSort
 }