Use publishedAt by default in videos sort
authorChocobozzz <me@florianbigard.com>
Tue, 15 May 2018 06:47:47 +0000 (08:47 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 15 May 2018 06:47:47 +0000 (08:47 +0200)
client/src/app/shared/video/abstract-video-list.ts
client/src/app/shared/video/sort-field.type.ts
client/src/app/videos/video-list/video-local.component.ts
client/src/app/videos/video-list/video-recently-added.component.ts
server/initializers/constants.ts

index 642a85f656ef6eb2a5f1345b86c24fbc39932966..d8a4b03afa804487d6f7ce621d51785e119458ec 100644 (file)
@@ -24,8 +24,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
     itemsPerPage: 10,
     totalItems: null
   }
-  sort: VideoSortField = '-createdAt'
-  defaultSort: VideoSortField = '-createdAt'
+  sort: VideoSortField = '-publishedAt'
+  defaultSort: VideoSortField = '-publishedAt'
   syndicationItems = []
 
   loadOnInit = true
index 2a3ae4ddd8bc1fc77d2390219b675fd163bc5a06..2192745b9f4dbc120089dc1552d5ac71c2973f60 100644 (file)
@@ -1,5 +1,6 @@
 export type VideoSortField = 'name' | '-name'
                       | 'duration' | '-duration'
+                      | 'publishedAt' | '-publishedAt'
                       | 'createdAt' | '-createdAt'
                       | 'views' | '-views'
                       | 'likes' | '-likes'
index fd67be67b5cba2cee1d3a4fcc51d88e2b18c0d0e..abab7504fed4e34efb68d6ed4a01f5ab47286f50 100644 (file)
@@ -17,7 +17,7 @@ import { VideoFilter } from '../../../../../shared/models/videos/video-query.typ
 export class VideoLocalComponent extends AbstractVideoList implements OnInit, OnDestroy {
   titlePage = 'Local videos'
   currentRoute = '/videos/local'
-  sort = '-createdAt' as VideoSortField
+  sort = '-publishedAt' as VideoSortField
   filter: VideoFilter = 'local'
 
   constructor (protected router: Router,
index 535b6e618433a8a8d58823a30e4722cfaca99e76..d064d9628ab16f1f33c7f08fb850185f91b6207a 100644 (file)
@@ -16,7 +16,7 @@ import { VideoService } from '../../shared/video/video.service'
 export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy {
   titlePage = 'Recently added'
   currentRoute = '/videos/recently-added'
-  sort: VideoSortField = '-createdAt'
+  sort: VideoSortField = '-publishedAt'
 
   constructor (protected router: Router,
                protected route: ActivatedRoute,
index 6c9b780682b9334352a3b1b14ccc47d3fda2144a..5a7d91160d8fd495323e9a512fabe1d916de8036 100644 (file)
@@ -30,7 +30,7 @@ const SORTABLE_COLUMNS = {
   JOBS: [ 'createdAt' ],
   VIDEO_ABUSES: [ 'id', 'createdAt' ],
   VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
-  VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ],
+  VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes' ],
   VIDEO_COMMENT_THREADS: [ 'createdAt' ],
   BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ],
   FOLLOWERS: [ 'createdAt' ],