X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-list%2Fvideo-recently-added.component.ts;h=ac1fcfff379dc12faef537fddc28a3265c07a43c;hb=d59cba295b7f2ead41e1828c1567e60942476367;hp=535b6e618433a8a8d58823a30e4722cfaca99e76;hpb=2a2c19dfef7a9aa313c6ca0798f271c9a63449a9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts index 535b6e618..ac1fcfff3 100644 --- a/client/src/app/videos/video-list/video-recently-added.component.ts +++ b/client/src/app/videos/video-list/video-recently-added.component.ts @@ -7,6 +7,8 @@ import { AuthService } from '../../core/auth' import { AbstractVideoList } from '../../shared/video/abstract-video-list' import { VideoSortField } from '../../shared/video/sort-field.type' import { VideoService } from '../../shared/video/video.service' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { ScreenService } from '@app/shared/misc/screen.service' @Component({ selector: 'my-videos-recently-added', @@ -14,17 +16,23 @@ import { VideoService } from '../../shared/video/video.service' templateUrl: '../../shared/video/abstract-video-list.html' }) export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage = 'Recently added' + titlePage: string currentRoute = '/videos/recently-added' - sort: VideoSortField = '-createdAt' - - constructor (protected router: Router, - protected route: ActivatedRoute, - protected location: Location, - protected notificationsService: NotificationsService, - protected authService: AuthService, - private videoService: VideoService) { + sort: VideoSortField = '-publishedAt' + + constructor ( + protected router: Router, + protected route: ActivatedRoute, + protected location: Location, + protected notificationsService: NotificationsService, + protected authService: AuthService, + protected i18n: I18n, + protected screenService: ScreenService, + private videoService: VideoService + ) { super() + + this.titlePage = i18n('Recently added') } ngOnInit () { @@ -40,10 +48,10 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On getVideosObservable (page: number) { const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.videoService.getVideos(newPagination, this.sort) + return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf) } generateSyndicationList () { - this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort) + this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf) } }